From 29853bd5bd44edf9729ce6941faa66b284292090 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Mon, 2 Mar 2020 22:07:16 +0300 Subject: [PATCH] # Add in pip and in python x32 + x64 --- .../Naked-0.1.31.dist-info/DESCRIPTION.rst | 36 + .../INSTALLER | 0 .../Naked-0.1.31.dist-info/METADATA | 61 + .../Naked-0.1.31.dist-info/RECORD | 118 + .../Naked-0.1.31.dist-info/WHEEL | 6 + .../Naked-0.1.31.dist-info/entry_points.txt | 3 + .../Naked-0.1.31.dist-info/pydist.json | 1 + .../Naked-0.1.31.dist-info/top_level.txt | 1 + .../Lib/site-packages/Naked/__init__.py | 0 .../Lib/site-packages/Naked/app.py | 229 + .../Lib/site-packages/Naked/commandline.py | 371 + .../site-packages/Naked/commands/__init__.py | 0 .../Lib/site-packages/Naked/commands/args.py | 120 + .../Lib/site-packages/Naked/commands/build.py | 40 + .../Naked/commands/classifier.py | 60 + .../Lib/site-packages/Naked/commands/dist.py | 93 + .../Lib/site-packages/Naked/commands/help.py | 17 + .../site-packages/Naked/commands/locate.py | 51 + .../Lib/site-packages/Naked/commands/make.py | 388 + .../site-packages/Naked/commands/profile.py | 56 + .../Lib/site-packages/Naked/commands/pyh.py | 48 + .../Lib/site-packages/Naked/commands/test.py | 204 + .../Lib/site-packages/Naked/commands/usage.py | 17 + .../site-packages/Naked/commands/version.py | 25 + .../Lib/site-packages/Naked/scratchpad.py | 28 + .../Lib/site-packages/Naked/settings.py | 86 + .../site-packages/Naked/templates/__init__.py | 0 .../site-packages/Naked/templates/app_file.py | 101 + .../site-packages/Naked/templates/licenses.py | 140 + .../Naked/templates/manifest_in_file.py | 5 + .../Naked/templates/profiler_file.py | 45 + .../Naked/templates/pypush_file.py | 32 + .../Naked/templates/readme_md_file.py | 8 + .../Naked/templates/settings_file.py | 35 + .../Naked/templates/setup_cfg_file.py | 8 + .../Naked/templates/setup_py_file.py | 56 + .../site-packages/Naked/toolshed/__init__.py | 0 .../Naked/toolshed/benchmarking.py | 463 + .../Naked/toolshed/c/__init__.py | 0 .../Naked/toolshed/c/benchmarking.c | 16546 +++++++++++ .../Naked/toolshed/c/benchmarking.pyx | 463 + .../site-packages/Naked/toolshed/c/build.sh | 1 + .../site-packages/Naked/toolshed/c/casts.c | 5294 ++++ .../site-packages/Naked/toolshed/c/casts.pyx | 117 + .../site-packages/Naked/toolshed/c/cstate.c | 3202 ++ .../site-packages/Naked/toolshed/c/cstate.pyx | 35 + .../Naked/toolshed/c/cythonize.sh | 15 + .../Lib/site-packages/Naked/toolshed/c/file.c | 12542 ++++++++ .../site-packages/Naked/toolshed/c/file.pyx | 377 + .../Lib/site-packages/Naked/toolshed/c/ink.c | 4232 +++ .../site-packages/Naked/toolshed/c/ink.pyx | 106 + .../site-packages/Naked/toolshed/c/network.c | 10338 +++++++ .../Naked/toolshed/c/network.pyx | 352 + .../site-packages/Naked/toolshed/c/python.c | 2650 ++ .../site-packages/Naked/toolshed/c/python.pyx | 53 + .../site-packages/Naked/toolshed/c/setup.py | 18 + .../site-packages/Naked/toolshed/c/shell.c | 8175 +++++ .../site-packages/Naked/toolshed/c/shell.pyx | 264 + .../site-packages/Naked/toolshed/c/system.c | 13040 ++++++++ .../site-packages/Naked/toolshed/c/system.pyx | 554 + .../site-packages/Naked/toolshed/c/types.c | 24613 ++++++++++++++++ .../site-packages/Naked/toolshed/c/types.pyx | 999 + .../Lib/site-packages/Naked/toolshed/casts.py | 119 + .../Lib/site-packages/Naked/toolshed/file.py | 376 + .../Lib/site-packages/Naked/toolshed/git.py | 7 + .../Lib/site-packages/Naked/toolshed/ink.py | 105 + .../Lib/site-packages/Naked/toolshed/iter.py | 14 + .../site-packages/Naked/toolshed/network.py | 351 + .../site-packages/Naked/toolshed/python.py | 53 + .../Lib/site-packages/Naked/toolshed/shell.py | 263 + .../Lib/site-packages/Naked/toolshed/state.py | 34 + .../site-packages/Naked/toolshed/system.py | 553 + .../Lib/site-packages/Naked/toolshed/types.py | 992 + .../PyYAML-5.3.dist-info}/INSTALLER | 0 .../PyYAML-5.3.dist-info/LICENSE | 20 + .../PyYAML-5.3.dist-info/METADATA | 40 + .../site-packages/PyYAML-5.3.dist-info/RECORD | 40 + .../site-packages/PyYAML-5.3.dist-info/WHEEL | 5 + .../Lib/site-packages/_yaml.cp37-win32.pyd | Bin 0 -> 231424 bytes .../crypto-1.4.1.dist-info/DESCRIPTION.rst | 91 + .../crypto-1.4.1.dist-info/INSTALLER | 1 + .../crypto-1.4.1.dist-info/METADATA | 116 + .../crypto-1.4.1.dist-info/RECORD | 28 + .../crypto-1.4.1.dist-info/WHEEL | 6 + .../crypto-1.4.1.dist-info/entry_points.txt | 4 + .../crypto-1.4.1.dist-info/pydist.json | 1 + .../crypto-1.4.1.dist-info/top_level.txt | 1 + .../Lib/site-packages/crypto/__init__.py | 0 .../Lib/site-packages/crypto/app.py | 262 + .../Lib/site-packages/crypto/decryptoapp.py | 380 + .../site-packages/crypto/library/__init__.py | 0 .../site-packages/crypto/library/cryptor.py | 167 + .../Lib/site-packages/crypto/library/hash.py | 23 + .../site-packages/crypto/library/package.py | 45 + .../Lib/site-packages/crypto/settings.py | 104 + .../pyOpenRPA-1.0.42.dist-info/INSTALLER | 1 + .../pyOpenRPA-1.0.42.dist-info}/METADATA | 3 +- .../pyOpenRPA-1.0.42.dist-info}/RECORD | 22 +- .../WHEEL | 0 .../top_level.txt | 0 .../pyOpenRPA/Tools/SafeSource/Crypter.py | 79 + .../pyOpenRPA/Tools/SafeSource/DistrCreate.py | 56 + .../pyOpenRPA/Tools/SafeSource/DistrRun.py | 161 + .../pyOpenRPA/Tools/SafeSource/__init__.py | 0 .../pyOpenRPA/Tools/SafeSource/__main__.py | 21 + .../Lib/site-packages/pyOpenRPA/__init__.py | 2 +- .../shellescape-3.8.1.dist-info/INSTALLER | 1 + .../shellescape-3.8.1.dist-info/METADATA | 99 + .../shellescape-3.8.1.dist-info/RECORD | 11 + .../shellescape-3.8.1.dist-info/WHEEL | 6 + .../shellescape-3.8.1.dist-info/top_level.txt | 1 + .../Lib/site-packages/shellescape/__init__.py | 4 + .../Lib/site-packages/shellescape/main.py | 19 + .../Lib/site-packages/shellescape/settings.py | 15 + .../Lib/site-packages/yaml/__init__.py | 427 + .../Lib/site-packages/yaml/composer.py | 139 + .../Lib/site-packages/yaml/constructor.py | 721 + .../Lib/site-packages/yaml/cyaml.py | 101 + .../Lib/site-packages/yaml/dumper.py | 62 + .../Lib/site-packages/yaml/emitter.py | 1137 + .../Lib/site-packages/yaml/error.py | 75 + .../Lib/site-packages/yaml/events.py | 86 + .../Lib/site-packages/yaml/loader.py | 63 + .../Lib/site-packages/yaml/nodes.py | 49 + .../Lib/site-packages/yaml/parser.py | 589 + .../Lib/site-packages/yaml/reader.py | 185 + .../Lib/site-packages/yaml/representer.py | 389 + .../Lib/site-packages/yaml/resolver.py | 227 + .../Lib/site-packages/yaml/scanner.py | 1435 + .../Lib/site-packages/yaml/serializer.py | 111 + .../Lib/site-packages/yaml/tokens.py | 104 + .../python-3.7.2/Scripts/crypto.exe | Bin 0 -> 93000 bytes .../python-3.7.2/Scripts/decrypto.exe | Bin 0 -> 93008 bytes .../WPy32-3720/python-3.7.2/Scripts/naked.exe | Bin 0 -> 92999 bytes .../Lib/site-packages/Crypto/__init__.py | 6 - .../Lib/site-packages/Crypto/app.py | 262 + .../Lib/site-packages/Crypto/decryptoapp.py | 380 + .../site-packages/Crypto/library/__init__.py | 0 .../site-packages/Crypto/library/cryptor.py | 167 + .../Lib/site-packages/Crypto/library/hash.py | 23 + .../site-packages/Crypto/library/package.py | 45 + .../Lib/site-packages/Crypto/settings.py | 104 + .../Naked-0.1.31.dist-info/DESCRIPTION.rst | 36 + .../Naked-0.1.31.dist-info/INSTALLER | 1 + .../Naked-0.1.31.dist-info/METADATA | 61 + .../Naked-0.1.31.dist-info/RECORD | 118 + .../Naked-0.1.31.dist-info/WHEEL | 6 + .../Naked-0.1.31.dist-info/entry_points.txt | 3 + .../Naked-0.1.31.dist-info/pydist.json | 1 + .../Naked-0.1.31.dist-info/top_level.txt | 1 + .../Lib/site-packages/Naked/__init__.py | 0 .../Lib/site-packages/Naked/app.py | 229 + .../Lib/site-packages/Naked/commandline.py | 371 + .../site-packages/Naked/commands/__init__.py | 0 .../Lib/site-packages/Naked/commands/args.py | 120 + .../Lib/site-packages/Naked/commands/build.py | 40 + .../Naked/commands/classifier.py | 60 + .../Lib/site-packages/Naked/commands/dist.py | 93 + .../Lib/site-packages/Naked/commands/help.py | 17 + .../site-packages/Naked/commands/locate.py | 51 + .../Lib/site-packages/Naked/commands/make.py | 388 + .../site-packages/Naked/commands/profile.py | 56 + .../Lib/site-packages/Naked/commands/pyh.py | 48 + .../Lib/site-packages/Naked/commands/test.py | 204 + .../Lib/site-packages/Naked/commands/usage.py | 17 + .../site-packages/Naked/commands/version.py | 25 + .../Lib/site-packages/Naked/scratchpad.py | 28 + .../Lib/site-packages/Naked/settings.py | 86 + .../site-packages/Naked/templates/__init__.py | 0 .../site-packages/Naked/templates/app_file.py | 101 + .../site-packages/Naked/templates/licenses.py | 140 + .../Naked/templates/manifest_in_file.py | 5 + .../Naked/templates/profiler_file.py | 45 + .../Naked/templates/pypush_file.py | 32 + .../Naked/templates/readme_md_file.py | 8 + .../Naked/templates/settings_file.py | 35 + .../Naked/templates/setup_cfg_file.py | 8 + .../Naked/templates/setup_py_file.py | 56 + .../site-packages/Naked/toolshed/__init__.py | 0 .../Naked/toolshed/benchmarking.py | 463 + .../Naked/toolshed/c/__init__.py | 0 .../Naked/toolshed/c/benchmarking.c | 16546 +++++++++++ .../Naked/toolshed/c/benchmarking.pyx | 463 + .../site-packages/Naked/toolshed/c/build.sh | 1 + .../site-packages/Naked/toolshed/c/casts.c | 5294 ++++ .../site-packages/Naked/toolshed/c/casts.pyx | 117 + .../site-packages/Naked/toolshed/c/cstate.c | 3202 ++ .../site-packages/Naked/toolshed/c/cstate.pyx | 35 + .../Naked/toolshed/c/cythonize.sh | 15 + .../Lib/site-packages/Naked/toolshed/c/file.c | 12542 ++++++++ .../site-packages/Naked/toolshed/c/file.pyx | 377 + .../Lib/site-packages/Naked/toolshed/c/ink.c | 4232 +++ .../site-packages/Naked/toolshed/c/ink.pyx | 106 + .../site-packages/Naked/toolshed/c/network.c | 10338 +++++++ .../Naked/toolshed/c/network.pyx | 352 + .../site-packages/Naked/toolshed/c/python.c | 2650 ++ .../site-packages/Naked/toolshed/c/python.pyx | 53 + .../site-packages/Naked/toolshed/c/setup.py | 18 + .../site-packages/Naked/toolshed/c/shell.c | 8175 +++++ .../site-packages/Naked/toolshed/c/shell.pyx | 264 + .../site-packages/Naked/toolshed/c/system.c | 13040 ++++++++ .../site-packages/Naked/toolshed/c/system.pyx | 554 + .../site-packages/Naked/toolshed/c/types.c | 24613 ++++++++++++++++ .../site-packages/Naked/toolshed/c/types.pyx | 999 + .../Lib/site-packages/Naked/toolshed/casts.py | 119 + .../Lib/site-packages/Naked/toolshed/file.py | 376 + .../Lib/site-packages/Naked/toolshed/git.py | 7 + .../Lib/site-packages/Naked/toolshed/ink.py | 105 + .../Lib/site-packages/Naked/toolshed/iter.py | 14 + .../site-packages/Naked/toolshed/network.py | 351 + .../site-packages/Naked/toolshed/python.py | 53 + .../Lib/site-packages/Naked/toolshed/shell.py | 263 + .../Lib/site-packages/Naked/toolshed/state.py | 34 + .../site-packages/Naked/toolshed/system.py | 553 + .../Lib/site-packages/Naked/toolshed/types.py | 992 + .../PyYAML-5.3.dist-info/INSTALLER | 1 + .../PyYAML-5.3.dist-info/LICENSE | 20 + .../PyYAML-5.3.dist-info/METADATA | 40 + .../site-packages/PyYAML-5.3.dist-info/RECORD | 40 + .../site-packages/PyYAML-5.3.dist-info/WHEEL | 5 + .../site-packages/_yaml.cp37-win_amd64.pyd | Bin 0 -> 275456 bytes .../crypto-1.4.1.dist-info/DESCRIPTION.rst | 91 + .../crypto-1.4.1.dist-info/INSTALLER | 1 + .../crypto-1.4.1.dist-info/METADATA | 116 + .../crypto-1.4.1.dist-info/RECORD | 28 + .../crypto-1.4.1.dist-info/WHEEL | 6 + .../crypto-1.4.1.dist-info/entry_points.txt | 4 + .../crypto-1.4.1.dist-info/pydist.json | 1 + .../crypto-1.4.1.dist-info/top_level.txt | 1 + .../pyOpenRPA-1.0.42.dist-info/INSTALLER | 1 + .../pyOpenRPA-1.0.42.dist-info}/METADATA | 3 +- .../pyOpenRPA-1.0.42.dist-info}/RECORD | 22 +- .../WHEEL | 0 .../top_level.txt | 0 .../pyOpenRPA/Tools/SafeSource/Crypter.py | 79 + .../pyOpenRPA/Tools/SafeSource/DistrCreate.py | 56 + .../pyOpenRPA/Tools/SafeSource/DistrRun.py | 161 + .../pyOpenRPA/Tools/SafeSource/__init__.py | 0 .../pyOpenRPA/Tools/SafeSource/__main__.py | 21 + .../Lib/site-packages/pyOpenRPA/__init__.py | 2 +- .../shellescape-3.8.1.dist-info/INSTALLER | 1 + .../shellescape-3.8.1.dist-info/METADATA | 99 + .../shellescape-3.8.1.dist-info/RECORD | 11 + .../shellescape-3.8.1.dist-info/WHEEL | 6 + .../shellescape-3.8.1.dist-info/top_level.txt | 1 + .../Lib/site-packages/shellescape/__init__.py | 4 + .../Lib/site-packages/shellescape/main.py | 19 + .../Lib/site-packages/shellescape/settings.py | 15 + .../Lib/site-packages/yaml/__init__.py | 427 + .../Lib/site-packages/yaml/composer.py | 139 + .../Lib/site-packages/yaml/constructor.py | 721 + .../Lib/site-packages/yaml/cyaml.py | 101 + .../Lib/site-packages/yaml/dumper.py | 62 + .../Lib/site-packages/yaml/emitter.py | 1137 + .../Lib/site-packages/yaml/error.py | 75 + .../Lib/site-packages/yaml/events.py | 86 + .../Lib/site-packages/yaml/loader.py | 63 + .../Lib/site-packages/yaml/nodes.py | 49 + .../Lib/site-packages/yaml/parser.py | 589 + .../Lib/site-packages/yaml/reader.py | 185 + .../Lib/site-packages/yaml/representer.py | 389 + .../Lib/site-packages/yaml/resolver.py | 227 + .../Lib/site-packages/yaml/scanner.py | 1435 + .../Lib/site-packages/yaml/serializer.py | 111 + .../Lib/site-packages/yaml/tokens.py | 104 + .../python-3.7.2.amd64/OpenRPA_RobotDB.exe | Bin 99856 -> 0 bytes .../python-3.7.2.amd64/OpenRPA_Studio.exe | Bin 99856 -> 0 bytes .../OpenRPA_ToolScreenScrapRecognize.exe | Bin 99856 -> 0 bytes .../python-3.7.2.amd64/Scripts/crypto.exe | Bin 0 -> 102728 bytes .../python-3.7.2.amd64/Scripts/decrypto.exe | Bin 0 -> 102736 bytes .../python-3.7.2.amd64/Scripts/naked.exe | Bin 0 -> 102727 bytes Sources/pyOpenRPA/__init__.py | 2 +- Sources/setup.py | 2 +- 273 files changed, 235068 insertions(+), 24 deletions(-) create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst rename Resources/WPy32-3720/python-3.7.2/Lib/site-packages/{pyOpenRPA-1.0.41.dist-info => Naked-0.1.31.dist-info}/INSTALLER (100%) create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/METADATA create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/RECORD create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/app.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commandline.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/args.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/build.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/classifier.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/dist.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/help.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/locate.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/make.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/profile.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/pyh.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/test.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/usage.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/version.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/scratchpad.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/settings.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/app_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/licenses.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/manifest_in_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/profiler_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/pypush_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/readme_md_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/settings_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_cfg_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_py_file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/benchmarking.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/build.sh create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cythonize.sh create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/setup.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.c create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.pyx create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/casts.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/file.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/git.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/ink.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/iter.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/network.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/python.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/shell.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/state.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/system.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/types.py rename Resources/{WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info => WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info}/INSTALLER (100%) create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/METADATA create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/RECORD create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/_yaml.cp37-win32.pyd create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/METADATA create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/RECORD create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/app.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/decryptoapp.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/cryptor.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/hash.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/package.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/settings.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER rename Resources/{WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info => WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info}/METADATA (98%) rename Resources/{WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info => WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info}/RECORD (96%) rename Resources/WPy32-3720/python-3.7.2/Lib/site-packages/{pyOpenRPA-1.0.41.dist-info => pyOpenRPA-1.0.42.dist-info}/WHEEL (100%) rename Resources/WPy32-3720/python-3.7.2/Lib/site-packages/{pyOpenRPA-1.0.41.dist-info => pyOpenRPA-1.0.42.dist-info}/top_level.txt (100%) create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/DistrCreate.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/DistrRun.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/__main__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/INSTALLER create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/METADATA create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/main.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/settings.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/__init__.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/composer.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/constructor.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/cyaml.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/dumper.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/emitter.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/error.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/events.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/loader.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/nodes.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/parser.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/reader.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/representer.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/resolver.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/scanner.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/serializer.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/tokens.py create mode 100644 Resources/WPy32-3720/python-3.7.2/Scripts/crypto.exe create mode 100644 Resources/WPy32-3720/python-3.7.2/Scripts/decrypto.exe create mode 100644 Resources/WPy32-3720/python-3.7.2/Scripts/naked.exe create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/app.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/decryptoapp.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/cryptor.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/hash.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/package.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/settings.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/INSTALLER create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/METADATA create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/RECORD create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/app.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commandline.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/args.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/build.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/classifier.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/dist.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/help.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/locate.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/make.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/profile.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/pyh.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/test.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/usage.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/version.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/scratchpad.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/settings.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/app_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/licenses.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/manifest_in_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/profiler_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/pypush_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/readme_md_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/settings_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_cfg_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_py_file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/benchmarking.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/build.sh create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cythonize.sh create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/setup.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.c create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.pyx create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/casts.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/file.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/git.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/ink.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/iter.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/network.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/python.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/shell.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/state.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/system.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/types.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/INSTALLER create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/METADATA create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/RECORD create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/_yaml.cp37-win_amd64.pyd create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/METADATA create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/RECORD create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER rename Resources/{WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info => WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info}/METADATA (98%) rename Resources/{WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info => WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info}/RECORD (96%) rename Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/{pyOpenRPA-1.0.41.dist-info => pyOpenRPA-1.0.42.dist-info}/WHEEL (100%) rename Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/{pyOpenRPA-1.0.41.dist-info => pyOpenRPA-1.0.42.dist-info}/top_level.txt (100%) create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/DistrCreate.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/DistrRun.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/__main__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/INSTALLER create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/METADATA create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/main.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/settings.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/__init__.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/composer.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/constructor.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/cyaml.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/dumper.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/emitter.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/error.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/events.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/loader.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/nodes.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/parser.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/reader.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/representer.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/resolver.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/scanner.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/serializer.py create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/tokens.py delete mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_RobotDB.exe delete mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_Studio.exe delete mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_ToolScreenScrapRecognize.exe create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Scripts/crypto.exe create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Scripts/decrypto.exe create mode 100644 Resources/WPy64-3720/python-3.7.2.amd64/Scripts/naked.exe diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst new file mode 100644 index 00000000..ff207c1d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst @@ -0,0 +1,36 @@ +About +------ + +`Naked `_ is a new Python command line application framework that is in development. The current release is a stable, testing release. + +Updates +-------- + +Changes, updates, and brief tutorials are available on the `developer log `_. + +QuickStart Guide +------------------ + +The quickstart guide is available at `http://docs.naked-py.com/quickstart.html `_. It demonstrates how the available tools can be incorporated into your development workflow, spanning the entire period from an empty project directory to your first PyPI version release. + +Documentation +-------------- + +Documentation is in development at `http://docs.naked-py.com/ `_ + +Issue Reporting +---------------- + +Issue reporting is available on the `GitHub repository `_ + +Contribute +----------- + +I would greatly appreciate feedback from anyone who is testing the framework. Feel free to contact me on Twitter (@csimpkins) if you have questions, comments, or problems. Please use the issue reporting link above for bug reports. + +Example Application +------------------- + +`Status `_ was built from the ground up with the Naked Framework. If you'd like to check out the source, it is available on `GitHub `_ + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/INSTALLER b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/INSTALLER similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/INSTALLER rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/INSTALLER diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/METADATA b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/METADATA new file mode 100644 index 00000000..0662854c --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/METADATA @@ -0,0 +1,61 @@ +Metadata-Version: 2.0 +Name: Naked +Version: 0.1.31 +Summary: A command line application framework +Home-page: http://naked-py.com +Author: Christopher Simpkins +Author-email: chris@zerolabs.net +License: MIT +Keywords: python,command line,system,application,framework,CLI +Platform: any +Classifier: Intended Audience :: Developers +Classifier: Natural Language :: English +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Dist: Naked +Requires-Dist: requests +Requires-Dist: pyyaml + +About +------ + +`Naked `_ is a new Python command line application framework that is in development. The current release is a stable, testing release. + +Updates +-------- + +Changes, updates, and brief tutorials are available on the `developer log `_. + +QuickStart Guide +------------------ + +The quickstart guide is available at `http://docs.naked-py.com/quickstart.html `_. It demonstrates how the available tools can be incorporated into your development workflow, spanning the entire period from an empty project directory to your first PyPI version release. + +Documentation +-------------- + +Documentation is in development at `http://docs.naked-py.com/ `_ + +Issue Reporting +---------------- + +Issue reporting is available on the `GitHub repository `_ + +Contribute +----------- + +I would greatly appreciate feedback from anyone who is testing the framework. Feel free to contact me on Twitter (@csimpkins) if you have questions, comments, or problems. Please use the issue reporting link above for bug reports. + +Example Application +------------------- + +`Status `_ was built from the ground up with the Naked Framework. If you'd like to check out the source, it is available on `GitHub `_ + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/RECORD new file mode 100644 index 00000000..bb8c07c9 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/RECORD @@ -0,0 +1,118 @@ +../../Scripts/naked.exe,sha256=rMRI4H8Qgi_Gxg9r50MNWd2wsP9DnbZLKLpKzLRkRD4,92999 +Naked-0.1.31.data/scripts/naked,sha256=Ps1mufxMkBG7wwaJHQ_nkMwOrPP1hTZLDH7YMNO4Y2E,285 +Naked-0.1.31.dist-info/DESCRIPTION.rst,sha256=26S5QwAzVdLRvvgm9ZsFe2VsF2f6xybGklQEMt0T05s,1450 +Naked-0.1.31.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Naked-0.1.31.dist-info/METADATA,sha256=z7IWAlMC3eIlNc8RlWxJ1feuDhdlQtziBOXXzcZK-c8,2341 +Naked-0.1.31.dist-info/RECORD,, +Naked-0.1.31.dist-info/WHEEL,sha256=SXYYsi-y-rEGIva8sB8iKF6bAFD6YDhmqHX5hI3fc0o,110 +Naked-0.1.31.dist-info/entry_points.txt,sha256=-7nL8pc5fnKhIUINYqLDa1jd3y-8jynn9u5qF9EyjqU,42 +Naked-0.1.31.dist-info/pydist.json,sha256=cSetsKYPMVxYIilVGZD_wtke5QtnHkWmKGTF5uDSV10,1119 +Naked-0.1.31.dist-info/top_level.txt,sha256=CG1yk0vViILO5nUzrfUqtOs-0IAsZBY1zLFGi3O-SCc,6 +Naked/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/__pycache__/__init__.cpython-37.pyc,, +Naked/__pycache__/app.cpython-37.pyc,, +Naked/__pycache__/commandline.cpython-37.pyc,, +Naked/__pycache__/scratchpad.cpython-37.pyc,, +Naked/__pycache__/settings.cpython-37.pyc,, +Naked/app.py,sha256=ifeYxmcVb3aolzqZNzeQGF6rnTuJatyM3swhf68G5cc,11880 +Naked/commandline.py,sha256=OJ-ktVQWZeKMTbC1r446M0m1BZidwBQMA5hpXrTMK5U,18918 +Naked/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/commands/__pycache__/__init__.cpython-37.pyc,, +Naked/commands/__pycache__/args.cpython-37.pyc,, +Naked/commands/__pycache__/build.cpython-37.pyc,, +Naked/commands/__pycache__/classifier.cpython-37.pyc,, +Naked/commands/__pycache__/dist.cpython-37.pyc,, +Naked/commands/__pycache__/help.cpython-37.pyc,, +Naked/commands/__pycache__/locate.cpython-37.pyc,, +Naked/commands/__pycache__/make.cpython-37.pyc,, +Naked/commands/__pycache__/profile.cpython-37.pyc,, +Naked/commands/__pycache__/pyh.cpython-37.pyc,, +Naked/commands/__pycache__/test.cpython-37.pyc,, +Naked/commands/__pycache__/usage.cpython-37.pyc,, +Naked/commands/__pycache__/version.cpython-37.pyc,, +Naked/commands/args.py,sha256=DhW7JF2FNU0ns3P0RrcKM_aN8Pn51zfgLpa7edS7QoE,4681 +Naked/commands/build.py,sha256=SDs5d6s4aCyT6zKWpJ4CgYnu8VKx910CKRe-E9mFhS8,1040 +Naked/commands/classifier.py,sha256=NY4eOKDh3xiSJbJfvxN8D-YqjJrqc8qQ9e03vlPAf-A,1875 +Naked/commands/dist.py,sha256=qGG1l9Z1T882WvRjBKIs-UQWSbN9efaZkK-qSYTTVV4,3287 +Naked/commands/help.py,sha256=cQzrW2Axb4X_zR4JElmCaWUcE1xk2Sf9VpNO31FAimA,300 +Naked/commands/locate.py,sha256=9wZ_RSCNju1hWGkrUGDOSlWTPg6cbA4_cKJuAKW4sxs,1449 +Naked/commands/make.py,sha256=ikbMj3T24LExBaxgd465DBNNemqZb8y6RHHnKJTsQFY,18788 +Naked/commands/profile.py,sha256=Rz_rWwdqXy6WrWrPaDCBrsVBwpJrwRCrsnHtqj-LmZ0,1700 +Naked/commands/pyh.py,sha256=Bqfo513IKwPB0xY4YvtUSdvpSIetE9tW-gfTG2VoMqY,1071 +Naked/commands/test.py,sha256=-T_cXmbS5BoL7wKuC6VxQ0W8-Q-dcRl64fVZsiEj75g,6720 +Naked/commands/usage.py,sha256=ASp5GkdPHEd9Nz_rYNfjojI0KXmHMhmbs7ktte6LecY,305 +Naked/commands/version.py,sha256=kSPrr4blhbTST1SNUEKnnD9UrP9UW7s9ehos-qiM5as,789 +Naked/scratchpad.py,sha256=NJ6NYQrmzVHDHOEagFcACuSp0C2FiyKhHwpZbz7VkXE,743 +Naked/settings.py,sha256=uXuD_QpSbaOL37N-p_4pk1Fsrb_uQpIl3wkg6uTR8Cw,2976 +Naked/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/templates/__pycache__/__init__.cpython-37.pyc,, +Naked/templates/__pycache__/app_file.cpython-37.pyc,, +Naked/templates/__pycache__/licenses.cpython-37.pyc,, +Naked/templates/__pycache__/manifest_in_file.cpython-37.pyc,, +Naked/templates/__pycache__/profiler_file.cpython-37.pyc,, +Naked/templates/__pycache__/pypush_file.cpython-37.pyc,, +Naked/templates/__pycache__/readme_md_file.cpython-37.pyc,, +Naked/templates/__pycache__/settings_file.cpython-37.pyc,, +Naked/templates/__pycache__/setup_cfg_file.cpython-37.pyc,, +Naked/templates/__pycache__/setup_py_file.cpython-37.pyc,, +Naked/templates/app_file.py,sha256=A874Fi7TBfX2O8uMEcYvNbpUvc15C-rrFbT9MLWOL0Q,5188 +Naked/templates/licenses.py,sha256=WF2mFsv8oH_xUdEJMY17oWxmjmShOagYBQRdGReIxxE,6052 +Naked/templates/manifest_in_file.py,sha256=9FkG7ZHdadisE-Uh7qdI69Hn-hfACTo7II8LG23bGBY,109 +Naked/templates/profiler_file.py,sha256=XSxC4nBng26j7NmmmOXHz2wZ4702FpAGntaNeQ8WGLw,1530 +Naked/templates/pypush_file.py,sha256=RUndgzH4y9LhYgka1oTvVB__yfvXdysNdK7qOzwONyE,586 +Naked/templates/readme_md_file.py,sha256=njESHWuw5heC2EjRe8m7BgY1Wv2gXMUSnf0SjXLLpB4,104 +Naked/templates/settings_file.py,sha256=bkCfQE_qp-tdXCwBdII_4IqaO2U5XJUyh-QvTypOW1s,1179 +Naked/templates/setup_cfg_file.py,sha256=Bl-AkoQWe2Ath13L68J6pnzVPyz0FRmr7vCKIdyeAkU,107 +Naked/templates/setup_py_file.py,sha256=Z2c0FpDTKnRP2txJB7fSCEkD17CnyTgIFOLCRlR_kgs,1769 +Naked/toolshed/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/toolshed/__pycache__/__init__.cpython-37.pyc,, +Naked/toolshed/__pycache__/benchmarking.cpython-37.pyc,, +Naked/toolshed/__pycache__/casts.cpython-37.pyc,, +Naked/toolshed/__pycache__/file.cpython-37.pyc,, +Naked/toolshed/__pycache__/git.cpython-37.pyc,, +Naked/toolshed/__pycache__/ink.cpython-37.pyc,, +Naked/toolshed/__pycache__/iter.cpython-37.pyc,, +Naked/toolshed/__pycache__/network.cpython-37.pyc,, +Naked/toolshed/__pycache__/python.cpython-37.pyc,, +Naked/toolshed/__pycache__/shell.cpython-37.pyc,, +Naked/toolshed/__pycache__/state.cpython-37.pyc,, +Naked/toolshed/__pycache__/system.cpython-37.pyc,, +Naked/toolshed/__pycache__/types.cpython-37.pyc,, +Naked/toolshed/benchmarking.py,sha256=Dn5EXmR_wiAtG-mqWmBFQJ_i749_-hZ1-PxEBwSsAwQ,17235 +Naked/toolshed/c/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/toolshed/c/__pycache__/__init__.cpython-37.pyc,, +Naked/toolshed/c/__pycache__/setup.cpython-37.pyc,, +Naked/toolshed/c/benchmarking.c,sha256=UDYMyo3eaMQB0cc28AfkyePULEQuvtqaFeZWK9DgzLM,880286 +Naked/toolshed/c/benchmarking.pyx,sha256=Dn5EXmR_wiAtG-mqWmBFQJ_i749_-hZ1-PxEBwSsAwQ,17235 +Naked/toolshed/c/build.sh,sha256=LEtZwrw9A6Tx4Z-tSf4kjSKFLTyX97xs5uoJBcitB8w,36 +Naked/toolshed/c/casts.c,sha256=bgEj7BmtKcHmMd1W5qIcOC8_KH5BP66z3x_tLMF4N7I,227012 +Naked/toolshed/c/casts.pyx,sha256=Jq6Wt3re7fS1-ry9uD4B38yfGi-CbwhxsLZl8HODNis,4813 +Naked/toolshed/c/cstate.c,sha256=qTe_e46gCtGYUdgt--ulHl9NaE4T_K7j7D5V93AUawA,134375 +Naked/toolshed/c/cstate.pyx,sha256=5EDxBjneKCRyEwQslZspCLl1A2i7dMtEIu1mfM75qpo,1089 +Naked/toolshed/c/cythonize.sh,sha256=-Fy5q0oMAqOKj5aFDfRuaQUPpqGrKCSDatPdFt0d_zI,256 +Naked/toolshed/c/file.c,sha256=DtLXGU5JzSJCDzC8tZxM0k_ucf3ONwepxB6Q1fipL1I,623270 +Naked/toolshed/c/file.pyx,sha256=ru3r-7QVgTubZ3sbbNO_jqF0o_qfJBYzfGSXPL7X18c,19965 +Naked/toolshed/c/ink.c,sha256=L0brN1oD-airTLFV378wfkLZ6r1MgAHozsl5GlaMjdo,185313 +Naked/toolshed/c/ink.pyx,sha256=r73b8N46boGa7Cerw88uPGk3luNQWgoE7SS2Ru4k0ys,5460 +Naked/toolshed/c/network.c,sha256=ft-bqnr3ervphD1IXiXN9krqZ6GJPmLA2OdrH9N8CaE,525661 +Naked/toolshed/c/network.pyx,sha256=-NX-7RFbN2DAsOdW4mvtNYnCP1GVHx8CQubmL7wjaQg,19549 +Naked/toolshed/c/python.c,sha256=E2rAQDq1pVgehMwDQenNF5ZZIBdpauHKA5TKFPWxBSk,111860 +Naked/toolshed/c/python.pyx,sha256=WTST5lYVqizCtAXbHZqd5HGOO9ywCCxP8dbzLB2tbcM,2157 +Naked/toolshed/c/setup.py,sha256=oOuer8J1ZqJxxWhXiYzmtPmyeaQy2FNQNp1c99AzF4U,654 +Naked/toolshed/c/shell.c,sha256=1CrgdwUQsHkkzKKvVYfmZoA6OaG23xqriKiO0a_secI,376470 +Naked/toolshed/c/shell.pyx,sha256=efpvnnT8cu6xXOGvhqd2MpMCiv2Z4Eau8VjRp9pAYSc,12629 +Naked/toolshed/c/system.c,sha256=bSRfuYZe8C5nIk2WZrcXm5eYeJZ-3OwD5gzx2jwUPtE,620280 +Naked/toolshed/c/system.pyx,sha256=bPjCcxkWLuS-X5CZgUC8Rkilc2x-S-X2e9MkvzEf-xw,24684 +Naked/toolshed/c/types.c,sha256=STvR0OE_PLkGros1B0vjepCZdhClEjjaCEkqyuZNMOc,1240797 +Naked/toolshed/c/types.pyx,sha256=ep0NkR_OFbmp96KaAx5mxPYYUTtc7V6L1qSkaLS_oq8,44721 +Naked/toolshed/casts.py,sha256=elaNlp0hBRJ_bFPTX-4eYB90gmPrbVPz_6TY4HFrbc8,5126 +Naked/toolshed/file.py,sha256=FnYhoVCgnTYU-WjedCLJFgsd9UkvbvJNt5J-ftWML3E,19941 +Naked/toolshed/git.py,sha256=WAX_snuOFpVIIBPRsIZXva24wK67MEBNZE5eST4fSDg,79 +Naked/toolshed/ink.py,sha256=9i_ZJpgpXtLqDs32OFGoeiNU7Ajo7xwKmI9FdCCcMt8,5436 +Naked/toolshed/iter.py,sha256=yUalH_tyXYtEqsFDuy2n5ZfussXmdFunzgA4W7Ydz9M,500 +Naked/toolshed/network.py,sha256=VpTSm6XQy2Pm_-atsqyt5vd9ZMnYFrJsfJhPwZ2R-js,19525 +Naked/toolshed/python.py,sha256=lY-Nb8nymApIyI4pWJNHst11VA8IJygBF62ASnjg9Yk,2158 +Naked/toolshed/shell.py,sha256=8hAdzS15TTzofHr2mRCLpf7ThTNiDVouQjWI18LSCNg,12605 +Naked/toolshed/state.py,sha256=_PnDMY5Vws9JXN6VdoQlNWwhZ1EwoiwUDu-qjl_Nmk4,1061 +Naked/toolshed/system.py,sha256=IeJhooglhxKbKiG5NYw6_ye8MeRKNSY5nOz1BZCZBNk,24660 +Naked/toolshed/types.py,sha256=xd_Bu_fKu0FbULD4EvwQ_OBYWMuBVj5r4pEx4Wm7riA,44532 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL new file mode 100644 index 00000000..f2ddc351 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.22.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt new file mode 100644 index 00000000..e69cfe8f --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +naked = Naked.app:main + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json new file mode 100644 index 00000000..9defc826 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json @@ -0,0 +1 @@ +{"license": "MIT", "exports": {"console_scripts": {"naked": "Naked.app:main"}}, "document_names": {"description": "DESCRIPTION.rst"}, "name": "Naked", "metadata_version": "2.0", "contacts": [{"role": "author", "email": "chris@zerolabs.net", "name": "Christopher Simpkins"}], "generator": "bdist_wheel (0.22.0)", "commands": {"wrap_console": {"naked": "Naked.app:main"}}, "summary": "A command line application framework", "project_urls": {"Home": "http://naked-py.com"}, "platform": "any", "run_requires": [{"requires": ["Naked", "requests", "pyyaml"]}], "version": "0.1.31", "keywords": "python,command line,system,application,framework,CLI", "classifiers": ["Intended Audience :: Developers", "Natural Language :: English", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules"], "extras": []} \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt new file mode 100644 index 00000000..007f0295 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt @@ -0,0 +1 @@ +Naked diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/app.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/app.py new file mode 100644 index 00000000..0b5218f0 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/app.py @@ -0,0 +1,229 @@ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# Naked | A Python command line application framework +# Copyright 2014 Christopher Simpkins +# MIT License +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------ +# c.cmd = Primary command ( ) +# c.cmd2 = Secondary command ( ) +# +# c.option(option_string, [bool argument_required]) = test for option with optional test for positional arg to the option +# c.option_with_arg(option_string) = test for option and mandatory positional argument to option test +# c.flag(flag_string) = test for presence of a "--option=argument" style flag +# +# c.arg(arg_string) = returns the next positional argument to the arg_string argument +# c.flag_arg(flag_string) = returns the flag assignment for a "--option=argument" style flag +#------------------------------------------------------------------------------------ + +# Application start +def main(): + import sys + from Naked.commandline import Command + #from Naked.toolshed.state import StateObject + from Naked.toolshed.system import stderr + + #------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + #------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + #------------------------------------------------------------------------------ + # [ Instantiate state object ] + #------------------------------------------------------------------------------ + #state = StateObject() + #------------------------------------------------------------------------------------------ + # [ Command Suite Validation ] - early validation of appropriate command syntax + # Test that user entered a primary command, print usage if not + #------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from Naked.commands.usage import Usage + Usage().print_usage() + sys.exit(1) + #------------------------------------------------------------------------------------------ + # [ PRIMARY COMMAND LOGIC ] + # Test for primary commands and handle them + #------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ args ] - identify the parsed arguments for a command string (2)= help + #------------------------------------------------------------------------------ + if c.cmd == "args": + if c.cmd2 == "help": + from Naked.commands.args import help as args_help + args_help() + elif c.argc > 0: # there is an argument to where that is not help + from Naked.commands.args import Args + a = Args(c.arg_to_cmd) + a.run() + else: + stderr("The args command requires an example command as an argument. Use 'naked args help' for more information.", 1) + #------------------------------------------------------------------------------ + # [ build ] - build the C code in the Naked library (2)= help + #------------------------------------------------------------------------------ + elif c.cmd == "build": + if c.cmd2 == "help": + from Naked.commands.build import help as build_help + build_help() + else: + from Naked.commands.build import compile_c_code + import os, inspect + abs_dirpath = os.path.join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))), "toolshed", "c") + compile_c_code(abs_dirpath) # function calls exit status code + #------------------------------------------------------------------------------ + # [ classify ] - search Python application classifiers and display to user (args)-search string + #------------------------------------------------------------------------------ + elif c.cmd == "classify": + if c.cmd2 == "help": + from Naked.commands.classifier import help as classifier_help + classifier_help() + else: + if c.second: # if search string was given + search_string = c.second + else: + search_string = "" # absence of search string detected in Classifier, defaults to the entire list instead of search + from Naked.commands.classifier import Classifier + c = Classifier(search_string) + c.run() + #------------------------------------------------------------------------------ + # [ dist ] - distribute source files to PyPI (2)=register, sdist, swheel, wheel, win, all, help + #------------------------------------------------------------------------------ + elif c.cmd == "dist": + if c.argc > 1: + from Naked.commands.dist import Dist + d = Dist() + if c.cmd2 == "register": # python setup.py register + d.run('register') + elif c.cmd2 == "sdist": # python setup.py sdist upload + d.run('sdist') + elif c.cmd2 == "swheel": # python setup.py sdist bdist_wheel upload + d.run('swheel') + elif c.cmd2 == "wheel": # python setup.py bdist_wheel upload + d.run('wheel') + elif c.cmd2 == "win": # python setup.py bdist_wininst upload + d.run('win') + elif c.cmd2 == "all": # python setup.py sdist bdist_wheel bdist_wininst upload + d.run('all') + elif c.cmd2 == "help": # help for command + from Naked.commands.dist import help as dist_help + dist_help() + else: + stderr("The naked dist secondary command was not recognized. Use 'naked dist help' for more information.", 1) + else: + stderr("Please enter a secondary command", 1) + #------------------------------------------------------------------------------ + # [ locate ] - locate Naked project files (2)= main, settings, setup, help + #------------------------------------------------------------------------------ + elif c.cmd == "locate": + from Naked.commands.locate import Locator + if c.cmd2 == "help": + from Naked.commands.locate import help as locate_help + locate_help() + elif c.cmd2 == "main": + l = Locator('main') + elif c.cmd2 == "settings": + l = Locator('settings') + elif c.cmd2 == "setup": + l = Locator('setup') + else: + l = Locator('') #handles error report to user + #------------------------------------------------------------------------------ + # [ make ] - make a new Naked project (2)=help (args)=project name + #------------------------------------------------------------------------------ + elif c.cmd == "make": + from Naked.commands.make import MakeController + if c.cmd2 == "help": + from Naked.commands.make import help as make_help + make_help() + if c.arg1: # arg1 is not help so use it as the argument to the make command + m = MakeController(c.arg1) + else: + m = MakeController(None) + m.run() + #------------------------------------------------------------------------------ + # [ profile ] - run the profiler.py file in the Naked project (2)=help + #------------------------------------------------------------------------------ + elif c.cmd == "profile": + if c.cmd2 == "help": + from Naked.commands.profile import help as profile_help + profile_help() + else: + from Naked.commands.profile import Profiler + p = Profiler() + p.run() + + #------------------------------------------------------------------------------ + # [ pyh ] - help for python built-in library modules, classes, methods, functions + #------------------------------------------------------------------------------ + elif c.cmd == "pyh": + if c.cmd2 == "help": + from Naked.commands.pyh import pyh_help + pyh_help() + else: + if c.argc > 1: + from Naked.commands.pyh import python_help + python_help(c.arg1) + else: + stderr("Please enter a query term with the pyh command. Use 'naked pyh help' for more information.", 1) + + #------------------------------------------------------------------------------ + # [ test ] - Run unit tests on the project (2)= help,nose,pytest,tox,unittest (see help for args) + #------------------------------------------------------------------------------ + elif c.cmd == "test": + if c.argc > 1: + if c.cmd2 == "help": + from Naked.commands.test import help as tox_help + tox_help() + elif c.cmd2 == "nose": + from Naked.commands.test import NoseTester + n = NoseTester() + n.run() + elif c.cmd2 == "pytest": + from Naked.commands.test import PyTester + p = PyTester() + p.run() + elif c.cmd2 == "tox": + from Naked.commands.test import ToxTester + if c.arg2: #user specified a python version to run with one of the tox version defs + t = ToxTester(c.arg2) #instantiate with the python version + else: + t = ToxTester() + t.run() + elif c.cmd2 == "unittest": + from Naked.commands.test import UnitTester + if c.arg2: + t = UnitTester(c.arg2) + t.run() + else: + stderr("Please include a unit test file path. Use 'naked test help' for more information.", 1) + else: + stderr("The secondary command was not recognized. Use 'naked test help' for more information.", 1) + else: + stderr("Please include a secondary command with the 'naked test' command. Use 'naked dist help' for more information.", 1) + + #------------------------------------------------------------------------------------------ + # [ NAKED FRAMEWORK COMMANDS ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/PROJECT/settings.py file + #------------------------------------------------------------------------------------------ + elif c.help(): # User requested naked help (help.py module in commands directory) + from Naked.commands.help import Help + Help().print_help() + elif c.usage(): # user requested naked usage info (usage.py module in commands directory) + from Naked.commands.usage import Usage + Usage().print_usage() + elif c.version(): # user requested naked version (version.py module in commands directory) + from Naked.commands.version import Version + Version().print_version() + #------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + #------------------------------------------------------------------------------------------ + else: + print("Could not complete the command that you entered. Please try again.") + sys.exit(1) #exit + +if __name__ == '__main__': + main() diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commandline.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commandline.py new file mode 100644 index 00000000..b51951f8 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commandline.py @@ -0,0 +1,371 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +from Naked.settings import debug as DEBUG_FLAG +##################################################################### +# [ Command class ] +# Command line command string object +# argv = list of command line arguments and options +# argc = count of command line arguments and options +# arg0 = first positional argument to command +# arg1 = second positional argument to command +# arglp = last positional argument to command +# cmd = primary command for command suite application (=arg0) +# cmd2 = secondary command for command suite application (=arg1) +# snippet for py block comment = #py + TAB +##################################################################### +class Command: + def __init__(self, app_path, argv): + self.argobj = Argument(argv) # create an Argument obj + self.optobj = Option(argv) # create an Option obj + self.app = app_path # path to application executable file + self.argv = argv # list of the command arguments argv[0] is first argument + self.argc = len(argv) # length of the argument list + self.arg0 = self.argobj._getArg(0) # define the first positional argument + self.arg1 = self.argobj._getArg(1) # define the second positional argument + self.arg2 = self.argobj._getArg(2) # define the third postitional argument + self.arg3 = self.argobj._getArg(3) # define the fourth positional argument + self.arg4 = self.argobj._getArg(4) # define the fifth positional argument + self.arglp = self.argobj._getArg(len(argv) - 1) # define the last positional argument + self.first = self.arg0 + self.second = self.arg1 + self.third = self.arg2 + self.fourth = self.arg3 + self.fifth = self.arg4 + self.last = self.arglp + self.arg_to_exec = self.arg0 # argument to the executable + self.arg_to_cmd = self.arg1 # argument to the primary command + self.cmd = self.arg0 # define the primary command variable as the first positional argument (user dependent & optional, may be something else) + self.cmd2 = self.arg1 # define the secondary command variable as the second positional argument (user dependent & optional, may be something else) + self.options = self.option_exists() # test for presence of at least one option (boolean) + self.flags = self.flag_exists() # test for presence of at least one flag (boolean) + + #------------------------------------------------------------------------------ + # [ app_validates_args method ] (boolean) + # Test whether app validates on the criterion arguments (argc) > 0, i.e. there is at least one argument to the executable + #------------------------------------------------------------------------------ + def app_validates_args(self): + try: + if self.argc > 0: + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Validation of application error in the app_validates() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ arg method ] (string) + # Return the NEXT positional argument to a command line object (e.g. an option that requires an argument) + # arg_recipient = the positional argument (at position n) to test for next positional argument + # returns next positional argument string at position n + 1 + #------------------------------------------------------------------------------------------ + def arg(self, arg_recipient): + try: + recipient_position = self.argobj._getArgPosition(arg_recipient) + return self.argobj._getArgNext(recipient_position) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing argument with arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ command method ] (boolean) + # Test that the command includes requested primary command suite command (cmd_str parameter) + # cmd_str = the command string to test for in command + # arugment_required = boolean - is an argument to this command required (default = no)? + # returns boolean for presence of the cmd_str + #------------------------------------------------------------------------------------------ + def command(self, cmd_str): + try: + if (cmd_str == self.cmd): + return True + else: + return False # if command is missing, return false + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command with command() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ command_arg method ] (string) + # Return the argument to the primary command as a string + #------------------------------------------------------------------------------ + def command_arg(self): + try: + return self.arg1 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command argument with command_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ command2_arg method ] (string) + # Return the argument to the secondary command as a string + #------------------------------------------------------------------------------ + def command2_arg(self): + try: + return self.arg2 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command argument with command_arg() method (Naked.commandline.py).") + raise e + #------------------------------------------------------------------------------------------ + # [ command_with_argument method ] (boolean) + # Test that the command includes requested primary command suite command (cmd_str parameter) and argument to it + # cmd_str = the command string to test for in command + # returns boolean for presence of the cmd_str AND presence of argument to the command + #------------------------------------------------------------------------------------------ + def command_with_argument(self, cmd_str): + try: + if (cmd_str == self.cmd): + argument_to_cmd = self.argobj._getArgNext(0) + if argument_to_cmd == "": # if the argument is missing, then return false + return False + else: + return True + else: + return False # if command is missing return false + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command and argument with command_with_argument() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ command_suite_validates method ] (boolean) + # Test that there is a primary command in a command suite application (to be used at the top level of logic for command line application) + # returns boolean for presence of the primary command + #------------------------------------------------------------------------------------------ + def command_suite_validates(self, accept_options_as_argument = True): + try: + if self.argc > 0: + if self.arg0.startswith("-") and accept_options_as_argument == False: + return False # if no command and option present, return False + else: + return True # if a primary command present, return True + else: + return False # if user only entered the application name, return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Command suite validation error with the command_suite_validation() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ flag method ] (boolean) + # Test for presence of flag in the command + #------------------------------------------------------------------------------ + def flag(self, flag_string): + try: + for match_string in self.optobj: #iterate through the options and attempt to match beginning of option to the requested flag + if match_string.startswith(flag_string): + return True + else: + pass + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing flags with the flag() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [flag_arg method] (string) + # Return the argument string assigned to a flag + #------------------------------------------------------------------------------ + def flag_arg(self, flag_string): + try: + for match_string in self.optobj: + if match_string.startswith(flag_string) and '=' in match_string: + flag_list = match_string.split("=") #split the flag on the equal symbol = list with [option, argument] + return flag_list[1] #return the argument to the flag option + else: + pass + return "" # return an empty string if unable to parse the argument + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing flags with the flag_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ flag_exists method ] (boolean) + # Test for the presence of a flag style option (--flag=argument) in the command + #------------------------------------------------------------------------------ + def flag_exists(self): + try: + for item in self.optobj: + if '=' in item: #test for presence of an = symbol in the option + return True # if present return True + break + return False # if didn't match across all options, return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing flags with the flag_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ option method ] (boolean) + # Test that the command includes an option (option_string parameter) + # option_string = the option string to test for in the command + # arugment_required = boolean - is an argument to this option required (default = no)? + # returns boolean for presence of the cmd_str + #------------------------------------------------------------------------------------------ + def option(self, option_string, argument_required = False): + try: + if (option_string in self.optobj): + argument_to_option = self.argobj._getArgNext(self.argobj._getArgPosition(option_string)) + if argument_required and ( argument_to_option == "" or argument_to_option.startswith("-") ): + return False + else: + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing option with option() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ option_arg method ] (string) + # Return the argument string to an option + #------------------------------------------------------------------------------ + def option_arg(self, option_string): + try: + return self.argobj._getArgNext(self.argobj._getArgPosition(option_string)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error returning argument to option with option_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ option_with_arg method ] (boolean) + # Test that the command includes an option (option_string parameter) and argument to that option + # option_string = the option string to test for in the command + # arugment_required = boolean - is an argument to this option required (default = yes)? + # returns boolean for presence of the option_string AND the argument + #------------------------------------------------------------------------------------------ + # test that command includes an option (option_string parameter) that includes an argument (=option(option_string, True)) + def option_with_arg(self, option_string, argument_required = True): + try: + if (option_string in self.optobj): + argument_to_option = self.argobj._getArgNext(self.argobj._getArgPosition(option_string)) + if argument_required and ( argument_to_option == "" or argument_to_option.startswith("-") ): + return False # argument is either missing or is another option, return false + else: + return True + else: + return False # option is not present + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing option and argument with option_with_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ option_exists method ] (boolean) + # Test whether there are any options in the command string + # returns boolean value for test "Is there at least one option?" + #------------------------------------------------------------------------------ + def option_exists(self): + try: + if len(self.optobj) > 0: + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error testing for the presence of at least one option with option_exists() method (Naked.commandline.py).") + raise e + #------------------------------------------------------------------------------ + # Naked provides the following commands for all applications that use the framework: + # -- help + # -- usage + # -- version + # These methods are accessed from the app.py module, main() as method calls on the command line object + # Parsing logic is coded below + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # Help Command/Option Handler + #------------------------------------------------------------------------------ + def help(self): + if ( (self.option("--help")) or (self.cmd == "help") or (self.option("-h")) ): + return True + else: + return False + + #------------------------------------------------------------------------------ + # Usage Command/Option Handler + #------------------------------------------------------------------------------ + def usage(self): + if ( (self.option("--usage")) or (self.cmd == "usage") ): + return True + else: + return False + + #------------------------------------------------------------------------------ + # Version Command/Option Handler + #------------------------------------------------------------------------------ + def version(self): + if ( (self.option("--version")) or (self.cmd == "version") or (self.option("-v"))): + return True + else: + return False + + #------------------------------------------------------------------------------ + # print the arguments with their corresponding argv list position to std out + #------------------------------------------------------------------------------ + def show_args(self): + x = 0 + for arg in self.argv: + print("argv[" + str(x) + "] = " + arg) + x = x + 1 + +#------------------------------------------------------------------------------ +# [ Argument Class ] +# all command line arguments (object inherited from Python list) +#------------------------------------------------------------------------------ +class Argument(list): + def __init__(self, argv): + self.argv = argv + list.__init__(self, self.argv) + + + # return argument at position specified by the 'position' parameter + def _getArg(self, position): + if ( self.argv ) and ( len(self.argv) > position ): + return self.argv[position] + else: + return "" + + # return position of user specified argument in the argument list + def _getArgPosition(self, test_arg): + if ( self.argv ): + if test_arg in self.argv: + return self.argv.index(test_arg) + else: + return -1 + + # return the argument at the next position following a user specified positional argument (e.g. for argument to an option in cmd) + def _getArgNext(self, position): + if len(self.argv) > (position + 1): + return self.argv[position + 1] + else: + return "" + +#------------------------------------------------------------------------------ +# [ Option Class ] +# Command line options (object inherited from Python list) +# Definition: string that begins with "-" (i.e. can be -h or --long) +#------------------------------------------------------------------------------ +class Option(list): + def __init__(self, argv): + self.argv = argv + list.__init__(self, self._make_option_list()) + + # make a list of the options in the command (defined as anything that starts with "-" character) + def _make_option_list(self): + optargv = [] + for x in self.argv: + if x.startswith("-"): + optargv.append(x) + return optargv diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/args.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/args.py new file mode 100644 index 00000000..739ae81d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/args.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.commandline import Command +from Naked.toolshed.system import exit_success +import shlex + +class Args: + def __init__(self, command_string): + self.com_string = command_string + + def run(self): + cmd_list = shlex.split(self.com_string) + c = Command(cmd_list[0], cmd_list[1:]) + print(' ') + print("•naked• Assuming that your Command object is instantiated as an instance named 'c', the command that you entered would be parsed as follows:") + print(' ') + print('Application') + print('-----------') + print('c.app = ' + c.app) + print(' ') + print('Argument List Length') + print('--------------------') + print('c.argc = ' + str(c.argc)) + print(' ') + print('Argument List Items') + print('-------------------') + print('c.argobj = ' + str(c.argobj)) + print(' ') + print('Arguments by Zero Indexed Start Position') + print('----------------------------------------') + print('c.arg0 = ' + c.arg0) + print('c.arg1 = ' + c.arg1) + print('c.arg2 = ' + c.arg2) + print('c.arg3 = ' + c.arg3) + print('c.arg4 = ' + c.arg4) + print(' ') + print('Arguments by Named Position') + print('---------------------------') + print('c.first = ' + c.first) + print('c.second = ' + c.second) + print('c.third = ' + c.third) + print('c.fourth = ' + c.fourth) + print('c.fifth = ' + c.fifth) + print(' ') + print('Last Positional Argument') + print('------------------------') + print('c.arglp = ' + c.arglp) + print('c.last = ' + c.last) + print(' ') + print('Primary & Secondary Commands') + print('----------------------------') + print('c.cmd = ' + c.cmd) + print('c.cmd2 = ' + c.cmd2) + print(' ') + print('Option Exists Tests') + print('------------------') + print('c.option_exists() = ' + str(c.option_exists())) + print('c.options = ' + str(c.options)) + print(' ') + print('Option Argument Assignment') + print('--------------------------') + if c.option_exists(): # if there are options, iterate through and print arguments to them + non_flag_options = False + for x in range(len(c.optobj)): + if '=' in c.optobj[x]: + continue # don't print flags, they are handled below + else: + print('c.arg("' + c.optobj[x] + '") = ' + c.arg(c.optobj[x])) + non_flag_options = True + if not non_flag_options: + print("There are no short or long options in the command.") + else: # otherwise, inform user that there are no options + print("There are no short options, long options, or flags in your command.") + print(' ') + print('Flag Exists Tests') + print('----------------') + print('c.flag_exists() = ' + str(c.flag_exists())) + print('c.flags = ' + str(c.flags)) + print(' ') + print('Flag Argument Assignment') + print('------------------------') + if c.flag_exists(): + for y in c.optobj: + if '=' in y: + the_flag = y.split('=')[0] + print('c.flag_arg("' + the_flag + '") = ' + c.flag_arg(the_flag)) + else: # provide message if there are no flags + print("There are no flag style arguments (--flag=argument) in your command.") + exit_success() + + +#------------------------------------------------------------------------------ +# [ help function ] - help for the where command +#------------------------------------------------------------------------------ +def help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked args Command Help +======================= +The args command displays information about the data that are parsed from a command string to Command object attributes and that are obtained from Command object methods. It is intended to help with the design of your application logic when you use the Naked command line parser. + +USAGE + naked args '' + +The command statement is a mandatory argument to the command. It should include a complete command as it would be entered on the command line, including the executable. The argument should be completely enclosed within quotes. + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLE + naked args 'testapp save somestring --unicode -s --name=file.txt'""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/build.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/build.py new file mode 100644 index 00000000..ef3b0d6f --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/build.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.toolshed.system import exit_success +#------------------------------------------------------------------------------ +# [ compile_c_code function ] (--none--) +# compile C files in the lib/Naked/toolshed/c directory +#------------------------------------------------------------------------------ +def compile_c_code(abs_dirpath): + from Naked.toolshed.shell import execute + from os import chdir + + chdir(abs_dirpath) + print('•naked• Compiling the C source library files...') + success = execute("python setup.py build_ext --inplace") + if success: + print(' ') + print('•naked• C source code compile complete.') + exit_success() + +def help(): + help_string = """ +Naked build Command Help +======================== +The build command compiles the Naked C libraries. This requires an installed C compiler. + +USAGE + naked build + +SECONDARY COMMANDS + none + +OPTIONS + none""" + print(help_string) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/classifier.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/classifier.py new file mode 100644 index 00000000..86c9bd00 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/classifier.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.toolshed.system import exit_success + +class Classifier: + def __init__(self, search_string): + self.needle = search_string + self.url = 'https://pypi.python.org/pypi?%3Aaction=list_classifiers' + + def run(self): + from Naked.toolshed.network import HTTP + http = HTTP(self.url) # use the python.org url for the classifier list + + print('•naked• Pulling the classifier list from python.org...') + + res = http.get() # get the list + test_list = res.split('\n') # split on newlines + + if self.needle == "": # user did not enter a search string, print the entire list + print("•naked• You did not provide a search string. Here is the entire list:") + print(' ') + for item in test_list: + print(item) + else: # user entered a search string, find it + lower_needle = self.needle.lower() + print("•naked• Performing a case insensitive search for '" + self.needle + "'") + print(' ') + filtered_list = [ x for x in test_list if lower_needle in x.lower() ] #case insensitive match for the search string + for item in filtered_list: + print(item) + + exit_success() # exit with zero status code + +def help(): + help_string = """ +Naked classify Command Help +=========================== +The classify command performs a case-insensitive search of the PyPI application classifier list and displays the results. + +USAGE + naked classify [search string] + +The search string argument is optional. If you do not include a search string, the entire classifier list is displayed. + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLES + naked classify + naked classify Internet +""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/dist.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/dist.py new file mode 100644 index 00000000..fd60855a --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/dist.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import file_exists, stderr, exit_success +from Naked.toolshed.shell import run as shell_run + +class Dist: + def __init__(self): + self.register = "python setup.py register" + self.sdist = "python setup.py sdist upload" + self.wheel = "python setup.py bdist_wheel upload" + self.swheel = "python setup.py sdist bdist_wheel upload" + self.win = "python setup.py bdist_wininst upload" + self.all = "python setup.py sdist bdist_wheel bdist_wininst upload" + + #------------------------------------------------------------------------------ + # [ run method ] - iterates through up to 6 directories above current working + # directory and then runs command if setup.py found + #------------------------------------------------------------------------------ + def run(self, command): + setuppy_found = False + for i in range(6): # navigate up at most 4 directory levels to search for the setup.py file + if not self._is_setup_py_at_this_level(): + os.chdir(os.pardir) + else: + setuppy_found = True + self._run_dist_command(command) + break + if not setuppy_found: + stderr("Unable to locate the setup.py file for your project. Please confirm that you are in your project directory and try again.", 1) + else: + exit_success() + + # search for setup.py file + def _is_setup_py_at_this_level(self): + if file_exists('setup.py'): + return True + else: + return False + + # run the user requested command + def _run_dist_command(self, the_command): + if the_command in "register": + print('•naked• Running register...') + shell_run(self.register) + elif the_command in "sdist": + print('•naked• Running sdist...') + shell_run(self.sdist) + elif the_command in "wheel": + print('•naked• Running wheel...') + shell_run(self.wheel) + elif the_command in "swheel": + print('•naked• Running swheel...') + shell_run(self.swheel) + elif the_command in "win": + print('•naked• Running win...') + shell_run(self.win) + elif the_command in "all": + print('•naked• Running all...') + shell_run(self.all) + else: + stderr("Unrecognized command. Use 'naked dist help' to view the supported commands.", 1) + + +def help(): + help_string = """ +Naked dist Command Help +======================= +The dist secondary commands run the standard distutils 'python setup.py ' source/binary distribution commands. + +USAGE + naked dist + +SECONDARY COMMANDS python setup.py + all sdist bdist_wheel bdist_wininst upload + register register + sdist sdist upload + swheel sdist bdist_wheel upload + wheel bdist_wheel upload + win bdist_wininst upload + +OPTIONS + none + +EXAMPLES + naked dist register + naked dist sdist""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/help.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/help.py new file mode 100644 index 00000000..bc552430 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/help.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.settings +from Naked.toolshed.system import exit_success + +class Help: + def __init__(self): + self.help = Naked.settings.help + + def print_help(self): + print(self.help) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/locate.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/locate.py new file mode 100644 index 00000000..d490efd8 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/locate.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import stderr, exit_success + +class Locator: + def __init__(self, needle): + self.needle = needle + self.location = self._display_location() + + def _display_location(self): + if self.needle == 'main': + main_path = os.path.join('', 'lib', '', 'app.py') + print("app.py : " + main_path) + exit_success() + elif self.needle == "settings": + settings_path = os.path.join('', 'lib', '','settings.py') + print("settings.py : " + settings_path) + exit_success() + elif self.needle == "setup": + setup_path = os.path.join('', 'setup.py') + print("setup.py : " + setup_path) + exit_success() + else: + stderr("Unable to process the command. Use 'naked locate help' for more information.", 1) + +def help(): + help_string = """ +Naked locate Command Help +========================= +The locate command identifies the file path to commonly used files in your project directory. + +USAGE + naked locate + +SECONDARY COMMANDS + main - the main application script file, app.py + setup - the setup.py file + settings - the project settings files, settings.py + +OPTIONS + none + +EXAMPLE + naked locate main""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/make.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/make.py new file mode 100644 index 00000000..def59ff4 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/make.py @@ -0,0 +1,388 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.toolshed.system as system +import Naked.toolshed.python as python +import Naked.toolshed.file as nfile +import Naked.toolshed.ink as ink +from Naked.toolshed.types import XDict, XString +from Naked.toolshed.system import make_dirs, make_path, exit_success +import datetime +import sys + +## TODO: Check for a local settings file (appname.yaml) +## TODO: make directories and files +#------------------------------------------------------------------------------ +# [ MakeController class ] +# Top level logic for the make command +#------------------------------------------------------------------------------ +class MakeController: + def __init__(self, app_name): + self.app_name = app_name + + def run(self): + if self.app_name == None: + i = InfoCompiler(None) + data_container = i.getSetupFileInfo() + else: + i = InfoCompiler(self.app_name) + data_container = i.getUserInfo() + + db = DirectoryBuilder(data_container) + db.build() + fb = FileBuilder(data_container) + if fb.build_and_write(): # file writes were successful + main_script_path = make_path(data_container.app_name, 'lib', data_container.app_name, 'app.py') + settings_path = make_path(data_container.app_name, 'lib', data_container.app_name, 'settings.py') + command_dir = make_path(data_container.app_name, 'lib', data_container.app_name, 'commands') + setuppy_path = make_path(data_container.app_name, 'setup.py') + print(" ") + print(data_container.app_name + " was successfully built.") + print(" ") + print("-----") + print("Main application script: " + main_script_path) + print("Settings file: " + settings_path) + print("Commands directory: " + command_dir) + print("setup.py file: " + setuppy_path) + print("-----") + print(" ") + print("Use 'python setup.py develop' from the top level of your project and you can begin testing your application with the executable, " + data_container.app_name) + exit_success() +#------------------------------------------------------------------------------ +# [ InfoCompiler class ] +# obtain information from user in order to build a new project +#------------------------------------------------------------------------------ +class InfoCompiler: + def __init__(self, app_name): + self.data = DataContainer() + self.data.app_name = app_name + self.displayed_info_flag = 0 + + def getUserInfo(self): + if not self.displayed_info_flag: + print("We need some information to create your project.") + self.displayed_info_flag = 1 + # If no project name, then query for it because this is mandatory + if self.data.app_name == None: + if python.is_py2: + response = raw_input("Please enter your application name (q=quit): ") + else: + response = input("Please enter your application name (q=quit): ") + if len(response) > 0: + if response == "q": + print("Aborted project build.") + sys.exit(0) # user requested quit + else: + if len(response.split()) > 1: # if more than one word + print("The application name must be a single word. Please try again.") + self.getUserInfo() + else: + self.data.app_name = response + else: + print("The Naked project will not build without an application name. Please try again.") + return self.getUserInfo() + # if project name already set, then obtain the other optional information + if python.is_py2(): + self.data.developer = raw_input("Enter the licensing developer or organization (q=quit): ") + if self.data.developer == "q": + print("Aborted the project build.") + sys.exit(0) + self.data.license = raw_input("Enter the license type (or leave blank, q=quit): ") + if self.data.license == "q": + print("Aborted the project build.") + sys.exit(0) + else: + self.data.developer = input("Enter the licensing developer or organization: ") + if self.data.developer == "q": + print("Aborted the project build.") + sys.exit(0) + self.data.license = input("Enter the license type (or leave blank): ") + if self.data.license == "q": + print("Aborted the project build.") + sys.exit(0) + if self.confirmData(): + return self.data + else: + print("Let's try again...") + return self.getUserInfo() # try again + + def getSetupFileInfo(self): + files = system.list_all_files_cwd() + if len(files) > 0: + setupfile_exists = False + for a_file in files: + if 'naked.yaml' == a_file.lower(): # accepts any permutation of upper/lower case 'naked.yaml' + print("Detected a Naked project YAML setup file (" + a_file + ").") + setupfile_exists = True + fr = nfile.FileReader(a_file) + the_yaml = fr.read_utf8() + self.parseYaml(the_yaml) + if setupfile_exists: + if self.confirmData(): + return self.data + else: + print("Aborted the project build.") + if python.is_py2(): + response = raw_input("Would you like to modify this information? (y/n) ") + else: + response = input("Would you like to modify this information? (y/n) ") + if response in ['y', 'Y', 'Yes', 'YES', 'yes']: + self.displayed_info_flag = 1 + self.data.app_name = None + return self.getUserInfo() # return the result from the getUserInfo command to the calling method + else: + sys.exit(0) + else: + return self.getUserInfo() # there are files but no setup file, use the manual entry method + else: + return self.getUserInfo() # there are no files in the directory, use the manual entry method + + + def parseYaml(self, yaml_string): + import yaml + the_yaml = yaml.load(yaml_string) + # Parse project name + if 'application' in the_yaml: + self.data.app_name = the_yaml['application'] + else: + print("Unable to find the application name ('application' field) in naked.yaml") + if python.is_py2: + response = raw_input("Please enter your application name: ") + else: + response = input("Please enter your application name: ") + if len(response) > 0: + self.data.app_name = response # assign the application name at CL if was not entered in file + else: + print("The Naked project will not build without an application name. Please try again.") + self.displayed_info_flag = 1 + self.getUserInfo() + # Parse developer + if 'developer' in the_yaml: + self.data.developer = the_yaml['developer'] # set developer + else: + self.data.developer = "" + # Parse license type + if 'license' in the_yaml: + self.data.license = the_yaml['license'] # set license + else: + self.data.license = "" + + + def confirmData(self): + templ_str = getHeaderTemplate() + template = ink.Template(templ_str) + renderer = ink.Renderer(template, {'app_name': self.data.app_name, 'developer': self.data.developer, 'license': self.data.license, 'year': self.data.year}) + display_header = renderer.render() + print("\nPlease confirm the information below:") + print(display_header) + + if python.is_py2(): + response = raw_input("Is this correct? (y/n) ") + else: + response = input("Is this correct? (y/n) ") + + if response in ['y', 'Y', 'yes', 'YES']: + return True + else: + self.data.app_name = None + return False + +#------------------------------------------------------------------------------ +# [ getHeaderTemplate function ] (string) +# returns the Ink header template for user confirmation +#------------------------------------------------------------------------------ +def getHeaderTemplate(): + templ_str = """ +---------------------------------------------------------- + {{app_name}} + Copyright {{year}} {{developer}} + {{license}} +---------------------------------------------------------- + """ + return templ_str + +#------------------------------------------------------------------------------ +# [ DataContainer class ] +# state maintenance object that holds project information +#------------------------------------------------------------------------------ +class DataContainer: + def __init__(self): + self.cwd = system.cwd() + self.year = str(datetime.datetime.now().year) + +#------------------------------------------------------------------------------ +# [ DirectoryBuilder class ] +# generation of directory structure for a new project +#------------------------------------------------------------------------------ +class DirectoryBuilder: + def __init__(self, data_container): + self.data_container = data_container + + def build(self): + top_level_dir = self.data_container.app_name + second_level_dirs = ['docs', 'lib', 'tests'] + lib_subdir = make_path(self.data_container.app_name, 'commands') + + for xdir in second_level_dirs: + make_dirs(make_path(top_level_dir, xdir)) + + make_dirs(make_path(top_level_dir, 'lib', lib_subdir)) + +#------------------------------------------------------------------------------ +# [ FileBuilder class ] +# generate the files for a new project +#------------------------------------------------------------------------------ +class FileBuilder: + def __init__(self, data_container): + self.data_container = data_container + self.file_dictionary = {} + + def build_and_write(self): + self._make_file_paths() # create the file paths for all generated files + self._render_file_strings() # create the rendered template strings + self._make_file_dictionary() # make the file path : file string dictionary + self.write_files() # write out to files + return True # if made it this far without exception, return True to calling method to confirm file writes + + # files are included in self.file_dictionary as key = filepath, value = filestring pairs + # write the files to disk + def write_files(self): + the_file_xdict = XDict(self.file_dictionary) + for filepath, file_string in the_file_xdict.xitems(): + fw = nfile.FileWriter(filepath) + try: + fw.write_utf8(file_string) + except TypeError as te: # catch unicode write errors + fw.write(file_string) + + def _make_file_paths(self): + from Naked.toolshed.system import make_path + + self.top_manifestin = make_path(self.data_container.app_name, 'MANIFEST.in') + self.top_readmemd = make_path(self.data_container.app_name, 'README.md') + self.top_setupcfg = make_path(self.data_container.app_name, 'setup.cfg') + self.top_setuppy = make_path(self.data_container.app_name, 'setup.py') + self.docs_license = make_path(self.data_container.app_name, 'docs', 'LICENSE') + self.docs_readmerst = make_path(self.data_container.app_name, 'docs', 'README.rst') + self.lib_initpy = make_path(self.data_container.app_name, 'lib', '__init__.py') + self.com_initpy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, 'commands', '__init__.py') + self.tests_initpy = make_path(self.data_container.app_name, 'tests', '__init__.py') + self.lib_profilerpy = make_path(self.data_container.app_name, 'lib', 'profiler.py') + self.lib_proj_initpy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, '__init__.py') + self.lib_proj_apppy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, 'app.py') + self.lib_proj_settingspy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, 'settings.py') + + def _render_file_strings(self): + from Naked.templates.manifest_in_file import manifest_file_string + from Naked.templates.readme_md_file import readme_md_string + from Naked.templates.setup_cfg_file import setup_cfg_string + from Naked.templates.setup_py_file import setup_py_string + from Naked.templates.profiler_file import profiler_file_string + from Naked.templates.app_file import app_file_string + from Naked.templates.settings_file import settings_file_string + + data_dict = self.data_container.__dict__ + + self.top_manifestin_rendered = manifest_file_string # no replacements necessary + self.top_readmemd_rendered = self._render_template(self._create_template(readme_md_string), data_dict) #requires app_name replacement + self.top_setupcfg_rendered = setup_cfg_string # no replacement necessary + self.top_setuppy_rendered = self._render_template(self._create_template(setup_py_string), data_dict) # requires app_name, developer replacements + self.docs_readmerst_rendered = "" # blank document stub write + self.lib_profilerpy_rendered = profiler_file_string # no replacement necessary + self.initpy_rendered = "" # blank __init__.py files + self.lib_proj_apppy_rendered = self._render_template(self._create_template(app_file_string), data_dict) # requires app_name, developer, license_name, year replacements + self.lib_proj_settingspy_rendered = self._render_template(self._create_template(settings_file_string), data_dict) # requires app_name replacement + + if len(self.data_container.license) > 0: + license = self.parse_licenses(self.data_container.license) # find the appropriate license template if the license was provided by user + if len(license) > 0: # could be empty string if fails to match a license template provided by Naked + self.docs_license_rendered = self._render_template(self._create_template(license), data_dict) + else: + self.docs_license_rendered = "" + + def _make_file_dictionary(self): + file_dictionary = {} + ## File path : file string key/value pairs > make as XString and encode as unicode for unicode file writes + file_dictionary[self.top_manifestin] = XString(self.top_manifestin_rendered).unicode().strip() + file_dictionary[self.top_readmemd] = XString(self.top_readmemd_rendered).unicode().strip() + file_dictionary[self.top_setupcfg] = XString(self.top_setupcfg_rendered).unicode().strip() + file_dictionary[self.top_setuppy] = XString(self.top_setuppy_rendered).unicode().strip() + file_dictionary[self.docs_license] = XString(self.docs_license_rendered).unicode().strip() + file_dictionary[self.docs_readmerst] = XString(self.docs_readmerst_rendered).unicode().strip() + file_dictionary[self.lib_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.com_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.tests_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.lib_profilerpy] = XString(self.lib_profilerpy_rendered).unicode().strip() + file_dictionary[self.lib_proj_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.lib_proj_apppy] = XString(self.lib_proj_apppy_rendered).unicode().strip() + file_dictionary[self.lib_proj_settingspy] = XString(self.lib_proj_settingspy_rendered).unicode().strip() + + self.file_dictionary = file_dictionary + + def _create_template(self, template_string): + return ink.Template(template_string) + + def _render_template(self, template, key_dict): + r = ink.Renderer(template, key_dict) + return r.render() + + def parse_licenses(self, license_string): + if len(license_string) > 0: + license = license_string.lower() # case insensitive matching, make lower case version + + if license.startswith('apache'): + from Naked.templates.licenses import apache_license + return apache_license + elif license.startswith('bsd'): + from Naked.templates.licenses import bsd_license + return bsd_license + elif license.startswith('gpl'): + from Naked.templates.licenses import gpl3_license + return gpl3_license + elif license.startswith('lgpl'): + from Naked.templates.licenses import lgpl_license + return lgpl_license + elif license.startswith('mit'): + from Naked.templates.licenses import mit_license + return mit_license + elif license.startswith('mozilla'): + from Naked.templates.licenses import mozilla_license + return mozilla_license + else: + return "" + +def help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked make Command Help +======================= +The make command builds a new Naked project. The project can be built from either responses that you give on the command line, or from a naked.yaml project settings file. + +USAGE + naked make [argument] + +The command should be run in the top level of the path where you would like to create your project. The argument to the make command is optional. If used, this is the name of your new project. It is not necessary to include the argument if you use a naked.yaml project settings file. + +The naked.yaml settings file has the following structure: + + application: + developer: + license: + +Place this in the top level of an empty directory and use `naked make` in the same directory. Naked will confirm your settings and then build the project directories and files from these settings. + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLES + naked make + naked make testapp""" + print(help_string) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/profile.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/profile.py new file mode 100644 index 00000000..47e8451f --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/profile.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import file_exists, dir_exists, stderr, exit_success + +class Profiler: + def __init__(self, dir_levels = 6): + self.number_of_dir_levels = dir_levels # number of directory levels to bottom to top search + + def run(self): + lib_found = False + for i in range(self.number_of_dir_levels): + if not self._is_lib_at_this_level(): + os.chdir(os.pardir) + else: + lib_found = True + break + if lib_found: + os.chdir('lib') # chdir to the lib directory if it is found + if file_exists('profiler.py'): # confirm that profiler.py exists + os.system('python profiler.py') # run the profiler.py file + exit_success() + else: + stderr("Unable to locate a profiler.py file in your lib directory.", 1) + else: + stderr("Unable to locate your profiler.py file. Please navigate to your project directory.", 1) + + def _is_lib_at_this_level(self): + if dir_exists('lib'): + return True + else: + return False + + +def help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked profile Command Help +========================== +The profile command runs cProfile and pstats on the code that you enter in test code block of your PROJECT/lib/profiler.py file. + +USAGE + naked profile + +SECONDARY COMMANDS + none + +OPTIONS + none + +This command searches bottom to top (from the working directory) through up to 6 directory levels to identify the lib/profiler.py path.""" + + print(help_string) + exit_success() + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/pyh.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/pyh.py new file mode 100644 index 00000000..674506f8 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/pyh.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys + +def python_help(help_string): + try: + needle = help_string + if needle.startswith("'") and needle.endswith("'"): + needle = needle[1:-1] + elif needle.startswith('"') and needle.endswith('"'): + needle = needle[1:-1] + help(needle) + except Exception as e: + print(e) + sys.stderr.write("•naked• There was an error processing the query.") + sys.exit(1) + +def pyh_help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked pyh Command Help +====================== +The pyh command searches the built-in Python documentation for a query term. The query term can be a Python built-in module, class/type, method, or function. + +USAGE + naked pyh + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLES + Module Docs: naked pyh sys + + Class Docs: naked pyh dict + + Method Docs: naked pyh dict.update + + Function Docs: naked pyh max""" + + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/test.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/test.py new file mode 100644 index 00000000..6d292008 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/test.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import cwd, file_exists, dir_exists, stderr, exit_success + +#------------------------------------------------------------------------------ +# [ ToxTester class ] +# Run Tox on the project directory, by default runs all python versions in tox.ini +# Optional specify the version of Python to test in constructor (runs 'tox -e py') +# Optional specify the number of directory levels `dir_levels` to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class ToxTester: + def __init__(self, py_version="", dir_levels = 6): + self.py_version = py_version + self.number_of_dir_levels = dir_levels + + def run(self): + tox_found = False + for i in range(self.number_of_dir_levels): + if not self._is_tox_ini_at_this_level(): + os.chdir(os.pardir) + else: + tox_found = True + self._run_tox() + break + if not tox_found: + stderr("Unable to locate your tox.ini file. Please navigate to your project directory.", 1) + else: + exit_success() + + def _is_tox_ini_at_this_level(self): + if file_exists('tox.ini'): + return True + else: + return False + + def _run_tox(self): + if self.py_version == "": + os.system("tox") + else: + cmd_string = "tox -e" + self.py_version + os.system(cmd_string) + +#------------------------------------------------------------------------------ +# [ NoseTester class ] +# run nose tests from the tests directory (works from any level of the project) +# Optional specify the number of directory levels to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class NoseTester: + def __init__(self, dir_levels = 6): + self.number_of_dir_levels = dir_levels + + def run(self): + nose_found = False + for i in range(self.number_of_dir_levels): + if not self._is_testdir_at_this_level(): + os.chdir(os.pardir) + else: + nose_found = True + self._run_nose() + break + if not nose_found: + stderr("Unable to locate your testing directory", 1) + else: + exit_success() + + def _is_testdir_at_this_level(self): + if file_exists('setup.py'): + if dir_exists('tests'): + return True + else: + return False #found setup.py but no tests directory + else: + return False # setup.py not at this level + + def _run_nose(self): + os.system("nosetests --where=tests") + + +#------------------------------------------------------------------------------ +# [ PyTester class ] +# run py.test test runner in the tests directory +# Optional specify the number of directory levels to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class PyTester: + def __init__(self, dir_levels = 6): + self.number_of_dir_levels = dir_levels + + def run(self): + py_found = False + for i in range(self.number_of_dir_levels): + if not self._is_testdir_at_this_level(): + os.chdir(os.pardir) + else: + py_found = True + self._run_pytests() + break + if not py_found: + stderr("Unable to locate your testing directory", 1) + else: + exit_success() + + def _is_testdir_at_this_level(self): + if file_exists('setup.py'): + if dir_exists('tests'): + return True + else: + return False + else: + return False + + def _run_pytests(self): + os.chdir('tests') + os.system('py.test') + +#------------------------------------------------------------------------------ +# [ UnitTester class ] +# run Python unit tests with the built in unittest methods +# Optional specify the number of directory levels to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class UnitTester: + def __init__(self, the_unit_test, dir_levels = 6): + self.unittest = the_unit_test + self.number_of_dir_levels = dir_levels + + def run(self): + unit_found = False + for i in range(self.number_of_dir_levels): + if not self._is_testdir_at_this_level(): + os.chdir(os.pardir) + else: + unit_found = True + os.chdir('tests') + if file_exists(self.unittest): + self._run_unittest() + else: + stderr("The unit test file " + self.unittest + " could not be found in the tests directory.") + if not unit_found: + stderr("Unable to locate your testing directory", 1) + else: + exit_success() + + def _is_testdir_at_this_level(self): + if file_exists('setup.py'): + if dir_exists('tests'): + return True + else: + return False + else: + return False + + def _run_unittest(self): + cmd_string = "python " + self.unittest + os.system(cmd_string) + + +def help(): + help_string = """ +Naked test Command Help +======================= +The test command allows you to run unit tests from any working directory in your project. + +USAGE + naked test [argument] + +SECONDARY COMMANDS + nose - run the nose test runner on your project + pytest - run the py.test test runner on your project + tox - run the tox test runner on your project + unittest - run Python unit tests (built-in) + +ARGUMENTS + nose + -- does not take additional arguments + + pytest + -- does not take additional arguments + + tox [python version] + -- You can include an optional tox Python version argument to run your + tests with a single version of Python (instead of the versions + specified in the tox.ini file). By default, the versions specified + in your tox.ini file are run. + + unittest + -- Mandatory unit test file path (relative to the tests directory) + +OPTIONS + none + +EXAMPLES + naked test nose + naked test pytest + naked test tox + naked test tox py27 + naked test unittest test_app.py + +A bottom to top search (from the working directory) is performed over up to 6 directory levels to find the 'tests' directory.""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/usage.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/usage.py new file mode 100644 index 00000000..d297bdd3 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/usage.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.settings +from Naked.toolshed.system import exit_success + +class Usage: + def __init__(self): + self.usage = Naked.settings.usage + + def print_usage(self): + print(self.usage) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/version.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/version.py new file mode 100644 index 00000000..46737f4e --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/commands/version.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.settings +from Naked.toolshed.system import exit_success + +class Version: + def __init__(self): + self.major_version = Naked.settings.major_version + self.minor_version = Naked.settings.minor_version + self.patch_version = Naked.settings.patch_version + self.name = Naked.settings.app_name + self.app_version_string = self.name + " " + self.major_version + "." + self.minor_version + "." + self.patch_version + self.version_string = self.major_version + "." + self.minor_version + "." + self.patch_version + + def print_version(self): + print(self.app_version_string) + exit_success() + + def get_version(self): + return self.version_string + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/scratchpad.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/scratchpad.py new file mode 100644 index 00000000..cb263482 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/scratchpad.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# import sys +# from functools import wraps +# from Naked.toolshed.types import XMaxHeap, XMinHeap + +# def print_scratch(func): +# @wraps(func) +# def print_wrapper(*args, **kwargs): +# print(func(*args, **kwargs)) +# return print_wrapper + + +# def run_scratchpad(): +# # from Naked.toolshed.file import FileReader +# # from Naked.toolshed.types import XString, XUnicode + +# # r = FileReader('/Users/ces/Desktop/code/naked/tests/testfiles/unicode.txt') +# # test1 = r.read_utf8() +# # test2 = XUnicode(test1, {'a': 'b'}) +# # test3 = "Hey! It's Bengali ব য,and here is some more ২" +# # print(unicode(test2)) + + + +# if __name__ == '__main__': +# run_scratchpad() diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/settings.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/settings.py new file mode 100644 index 00000000..e5daabdd --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/settings.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# Application Name +#------------------------------------------------------------------------------ +app_name = "naked" + +#------------------------------------------------------------------------------ +# Version Number +#------------------------------------------------------------------------------ +major_version = "0" +minor_version = "1" +patch_version = "31" + +#------------------------------------------------------------------------------ +# Debug Flag (switch to False for production release code) +#------------------------------------------------------------------------------ +debug = False + +#------------------------------------------------------------------------------ +# Usage String +#------------------------------------------------------------------------------ +usage = """ +Usage: naked [secondary command] [option(s)] [argument(s)] +--- Use 'naked help' for detailed help --- +""" + +#------------------------------------------------------------------------------ +# Help String +#------------------------------------------------------------------------------ +help = """ +--------------------------------------------------- + Naked + A Python command line application framework + Copyright 2014 Christopher Simpkins + MIT license +--------------------------------------------------- + +ABOUT + +The Naked framework includes the "naked" executable and the Python toolshed library. The naked executable is a command line tool for application development, testing, profiling, and deployment. The toolshed library contains numerous useful tools for application development that can be used through standard Python module imports. These features are detailed in the documentation (link below). + +USAGE + +The naked executable syntax is: + + naked [secondary command] [option(s)] [argument(s)] + +The is mandatory and includes one of the commands in the following section. The [bracketed] syntax structure is optional and dependent upon the primary command that you use. Use the command 'naked help' for details about a command. + +PRIMARY COMMANDS SECONDARY COMMANDS + + args help + build help + classify help + dist all•help•sdist•swheel•wheel•win + help - none - + locate main•help•settings•setup + make help + profile help + pyh help + test nose•pytest•tox•unittest + usage - none - + version - none - + +HELP + +To learn more about a primary command, use the following syntax: + + naked help + +DOCUMENTATION + + http://docs.naked-py.com + +SOURCE REPOSITORY + + https://github.com/chrissimpkins/naked + +ISSUE REPORTING + + https://github.com/chrissimpkins/naked/issues + +""" + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/app_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/app_file.py new file mode 100644 index 00000000..ff5cf42c --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/app_file.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = app_name, developer, license_name, year +app_file_string = """ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# {{app_name}} +# Copyright {{year}} {{developer}} +# {{license}} +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------ +# c.cmd = Primary command ({{app_name}} ) +# c.cmd2 = Secondary command ({{app_name}} ) +# +# c.arg_to_cmd = first positional argument to the primary command +# c.arg_to_cmd2 = first positional argument to the secondary command +# +# c.option(option_string, [bool argument_required]) = test for option with optional positional argument to option test +# c.option_with_arg(option_string) = test for option and mandatory positional argument to option +# c.flag(flag_string) = test for presence of a "option=argument" style flag +# +# c.arg(arg_string) = returns the next positional argument to the arg_string argument +# c.flag_arg(flag_string) = returns the flag assignment for a "--option=argument" style flag +#------------------------------------------------------------------------------------ + +# Application start +def main(): + import sys + from Naked.commandline import Command + from Naked.toolshed.state import StateObject + + #------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + #------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + #------------------------------------------------------------------------------ + # [ Instantiate state object ] + #------------------------------------------------------------------------------ + state = StateObject() + #------------------------------------------------------------------------------------------ + # [ Command Suite Validation ] - early validation of appropriate command syntax + # Test that user entered at least one argument to the executable, print usage if not + #------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from {{app_name}}.settings import usage as {{app_name}}_usage + print({{app_name}}_usage) + sys.exit(1) + #------------------------------------------------------------------------------------------ + # [ NAKED FRAMEWORK COMMANDS ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/{{app_name}}/settings.py file + #------------------------------------------------------------------------------------------ + if c.help(): # User requested {{app_name}} help information + from {{app_name}}.settings import help as {{app_name}}_help + print({{app_name}}_help) + sys.exit(0) + elif c.usage(): # User requested {{app_name}} usage information + from {{app_name}}.settings import usage as {{app_name}}_usage + print({{app_name}}_usage) + sys.exit(0) + elif c.version(): # User requested {{app_name}} version information + from {{app_name}}.settings import app_name, major_version, minor_version, patch_version + version_display_string = app_name + ' ' + major_version + '.' + minor_version + '.' + patch_version + print(version_display_string) + sys.exit(0) + #------------------------------------------------------------------------------------------ + # [ PRIMARY COMMAND LOGIC ] + # Enter your command line parsing logic below + #------------------------------------------------------------------------------------------ + + # [[ Example usage ]] ------------------------------->>> + # if c.cmd == 'hello': + # if c.cmd2 = 'world': + # if c.option('--print'): + # print('Hello World!') + # elif c.cmd == 'spam': + # if c.option_with_arg('--with'): + # friend_of_spam = c.arg('--with') # user enters {{app_name}} spam --with eggs + # print('spam and ' + friend_of_spam) # prints 'spam and eggs' + # elif c.cmd == 'naked': + # if c.flag("--language"): + # lang = c.flag_arg("--language") # user enters {{app_name}} naked --language=python + # print("Naked & " + lang) # prints 'Naked & python' + # End example --------------------------------------->>> + + #------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + #------------------------------------------------------------------------------------------ + else: + print("Could not complete the command that you entered. Please try again.") + sys.exit(1) #exit + +if __name__ == '__main__': + main() +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/licenses.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/licenses.py new file mode 100644 index 00000000..dfcbd7b4 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/licenses.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# ALL LICENSES: VARS = year, developer + +#------------------------------------------------------------------------------ +# [ apache_license ] +# The Apache License +#------------------------------------------------------------------------------ +apache_license = """ +Copyright {{year}} {{developer}} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +#------------------------------------------------------------------------------ +# [ bsd_license ] +# The BSD 2-clause license +#------------------------------------------------------------------------------ +bsd_license = """ +Copyright (c) {{year}}, {{developer}} +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +#------------------------------------------------------------------------------ +# [ gpl3_license ] +# The GPL v3 License +#------------------------------------------------------------------------------ +gpl3_license = """ +Copyright (C) {{year}} {{developer}} + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see [http://www.gnu.org/licenses/]. +""" + +#------------------------------------------------------------------------------ +# [lgpl_license ] +# The Lesser GPL license +#------------------------------------------------------------------------------ +lgpl_license = """ +Copyright (C) {{year}} {{developer}} + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +USA +""" + +#------------------------------------------------------------------------------ +# [ mit_license ] +# The MIT License +#------------------------------------------------------------------------------ +mit_license = """ +The MIT License (MIT) + +Copyright (c) {{year}} {{developer}} + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" + +#------------------------------------------------------------------------------ +# [ mozilla_license ] +# The Mozilla Public license, v2.0 +#------------------------------------------------------------------------------ +mozilla_license = """ +Mozilla Public License, v.2.0 + +Copyright (c) {{year}} {{developer}} + +This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. + +If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +""" + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/manifest_in_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/manifest_in_file.py new file mode 100644 index 00000000..16e1454d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/manifest_in_file.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = --none-- +manifest_file_string = "recursive-include docs *" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/profiler_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/profiler_file.py new file mode 100644 index 00000000..2b5cceed --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/profiler_file.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = --none-- +profiler_file_string = """ +#!/usr/bin/env python +# encoding: utf-8 + +import cProfile, pstats, StringIO + +def profile(): + #------------------------------------------------------------------------------ + # Setup a profile + #------------------------------------------------------------------------------ + pr = cProfile.Profile() + #------------------------------------------------------------------------------ + # Enter setup code below + #------------------------------------------------------------------------------ + # Optional: include setup code here + + + #------------------------------------------------------------------------------ + # Start profiler + #------------------------------------------------------------------------------ + pr.enable() + + #------------------------------------------------------------------------------ + # BEGIN profiled code block + #------------------------------------------------------------------------------ + # include profiled code here + + + #------------------------------------------------------------------------------ + # END profiled code block + #------------------------------------------------------------------------------ + pr.disable() + s = StringIO.StringIO() + sortby = 'cumulative' + ps = pstats.Stats(pr, stream=s).sort_stats(sortby) + ps.strip_dirs().sort_stats("time").print_stats() + print(s.getvalue()) + +if __name__ == '__main__': + profile() +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/pypush_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/pypush_file.py new file mode 100644 index 00000000..414c3cd2 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/pypush_file.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = year +pypush_file_string = """ +#!/bin/sh +# Scriptacular - pypush.sh +# Create a Python source distribution and push it to PyPI +# Copyright {{year}} Christopher Simpkins +# MIT License + + +# Build and push to PyPI +python setup.py sdist upload + +# Confirm that it worked +if (( $? )); then + echo "Unable to distribute your release to PyPI" >&2 + exit 1 +fi + +python setup.py bdist_wheel upload + +# Confirm that wheel distribution worked +if (( $? )); then + echo "Unable to distribute your wheel to PyPI" >&2 + exit 1 +fi + +# Exit success +exit 0 +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/readme_md_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/readme_md_file.py new file mode 100644 index 00000000..4bb5b0f6 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/readme_md_file.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS: app_name +readme_md_string = """ +{{app_name}} +===== +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/settings_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/settings_file.py new file mode 100644 index 00000000..ba5fddf8 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/settings_file.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = app_name +settings_file_string = """ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# Application Name +#------------------------------------------------------------------------------ +app_name = '{{app_name}}' + +#------------------------------------------------------------------------------ +# Version Number +#------------------------------------------------------------------------------ +major_version = "0" +minor_version = "1" +patch_version = "0" + +#------------------------------------------------------------------------------ +# Debug Flag (switch to False for production release code) +#------------------------------------------------------------------------------ +debug = True + +#------------------------------------------------------------------------------ +# Usage String +#------------------------------------------------------------------------------ +usage = '' + +#------------------------------------------------------------------------------ +# Help String +#------------------------------------------------------------------------------ +help = '' +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_cfg_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_cfg_file.py new file mode 100644 index 00000000..b3c096d1 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_cfg_file.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS: --none-- +setup_cfg_string = """ +[wheel] +universal = 1 +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_py_file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_py_file.py new file mode 100644 index 00000000..3b1bc541 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/templates/setup_py_file.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS: app_name, developer, license +setup_py_string = (""" +import os +import re +from setuptools import setup, find_packages + + +def docs_read(fname): + return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read() + +def version_read(): + settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', '{{app_name}}', 'settings.py')).read() + major_regex = """ + '"""' + """major_version\s*?=\s*?["']{1}(\d+)["']{1}""" + '"""' + '\n ' + + 'minor_regex = ' + '"""' + """minor_version\s*?=\s*?["']{1}(\d+)["']{1}""" + '"""' + '\n ' + + 'patch_regex = ' + '"""' + """patch_version\s*?=\s*?["']{1}(\d+)["']{1}""" + '"""' + '\n ' + + """major_match = re.search(major_regex, settings_file) + minor_match = re.search(minor_regex, settings_file) + patch_match = re.search(patch_regex, settings_file) + major_version = major_match.group(1) + minor_version = minor_match.group(1) + patch_version = patch_match.group(1) + if len(major_version) == 0: + major_version = 0 + if len(minor_version) == 0: + minor_version = 0 + if len(patch_version) == 0: + patch_version = 0 + return major_version + "." + minor_version + "." + patch_version + + +setup( + name='{{app_name}}', + version=version_read(), + description='', + long_description=(docs_read('README.rst')), + url='', + license='{{license}}', + author='{{developer}}', + author_email='', + platforms=['any'], + entry_points = { + 'console_scripts': [ + '{{app_name}} = {{app_name}}.app:main' + ], + }, + packages=find_packages("lib"), + package_dir={'': 'lib'}, + install_requires=['Naked'], + keywords='', + include_package_data=True, + classifiers=[], +) +""") diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/benchmarking.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/benchmarking.py new file mode 100644 index 00000000..63878bc0 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/benchmarking.py @@ -0,0 +1,463 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import time +import gc +from functools import wraps + +#------------------------------------------------------------------------------ +# [ timer function decorator ] +# runs timed repetitions of the decorated function in a single trial +# default is 100,000 repetitions in the trial +# reports the results of the trial +# Usage example: +# from Naked.toolshed.benchmarking import timer +# @timer +# def myfunction(): +#------------------------------------------------------------------------------ +def timer(func, repetitions=100000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_X function decorators ] +# replicate the above decorator with different number of repetitions +#------------------------------------------------------------------------------ + +def timer_10(func, repetitions=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_100(func, repetitions=100): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1k(func, repetitions=1000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_10k(func, repetitions=10000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1m(func, repetitions=1000000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark decorator function ] +# time a function and compare to a benchmark function +# default is 10 trials x 100,000 repetitions/trial for each function +# Results: +# - Mean of the 10 trials of the test function +# - standard deviation of the 10 trials (if numpy is available) +# - result for 100,000 repetitions of the benchmark function +# - ratio of the test : benchmark function results +# Usage example: +# from Naked.toolshed.benchmarking import timer_trials_benchmark +# @timer_trials_benchmark +# def myfunction(): +#------------------------------------------------------------------------------ +def timer_trials_benchmark(func, repetitions=100000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark_X decorators ] +# additional benchmark decorators that replicate the above function with different # repetitions +#------------------------------------------------------------------------------ +def timer_trials_benchmark_10(func, repetitions=10, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_100(func, repetitions=100, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.c new file mode 100644 index 00000000..c17440d5 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.c @@ -0,0 +1,16546 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:12 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__benchmarking +#define __PYX_HAVE_API__lib__Naked__toolshed__c__benchmarking +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "benchmarking.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m; + +/* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#include + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.benchmarking' */ +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = 0; +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.benchmarking" +int __pyx_module_is_main_lib__Naked__toolshed__c__benchmarking = 0; + +/* Implementation of 'lib.Naked.toolshed.c.benchmarking' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_[] = "()..."; +static char __pyx_k_L[] = "L"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k__2[] = " "; +static char __pyx_k__3[] = " : "; +static char __pyx_k_gc[] = "gc"; +static char __pyx_k_ie[] = "ie"; +static char __pyx_k_np[] = "np"; +static char __pyx_k__16[] = "()"; +static char __pyx_k__17[] = "."; +static char __pyx_k__19[] = ":\t"; +static char __pyx_k__20[] = "-"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_run[] = "run"; +static char __pyx_k_sec[] = " sec"; +static char __pyx_k_std[] = "std"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_end2[] = "end2"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mean[] = "mean"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_Ratio[] = "Ratio: "; +static char __pyx_k_Trial[] = "Trial "; +static char __pyx_k_array[] = "array"; +static char __pyx_k_flush[] = "flush"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_timer[] = "timer"; +static char __pyx_k_wraps[] = "wraps"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_enable[] = "enable"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_start2[] = "start2"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_trials[] = "trials"; +static char __pyx_k_collect[] = "collect"; +static char __pyx_k_disable[] = "disable"; +static char __pyx_k_wrapper[] = "wrapper"; +static char __pyx_k_Mean_for[] = "Mean for "; +static char __pyx_k_Starting[] = "Starting "; +static char __pyx_k_timer_10[] = "timer_10"; +static char __pyx_k_timer_1k[] = "timer_1k"; +static char __pyx_k_timer_1m[] = "timer_1m"; +static char __pyx_k_functools[] = "functools"; +static char __pyx_k_timer_100[] = "timer_100"; +static char __pyx_k_timer_10k[] = "timer_10k"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_repetitions[] = "repetitions"; +static char __pyx_k_result_list[] = "result_list"; +static char __pyx_k_repetitions_2[] = " repetitions: "; +static char __pyx_k_benchmark_list[] = "benchmark_list"; +static char __pyx_k_mean_benchmark[] = "mean_benchmark"; +static char __pyx_k_repetitions_of[] = " repetitions of "; +static char __pyx_k_Standard_Deviation[] = "Standard Deviation: "; +static char __pyx_k_Mean_per_repetition[] = "Mean per repetition: "; +static char __pyx_k_timer_locals_wrapper[] = "timer..wrapper"; +static char __pyx_k_of_benchmark_function[] = " of benchmark function:"; +static char __pyx_k_timer_trials_benchmark[] = "timer_trials_benchmark"; +static char __pyx_k_timer_10_locals_wrapper[] = "timer_10..wrapper"; +static char __pyx_k_timer_1k_locals_wrapper[] = "timer_1k..wrapper"; +static char __pyx_k_timer_1m_locals_wrapper[] = "timer_1m..wrapper"; +static char __pyx_k_Starting_timed_trials_of[] = "Starting timed trials of "; +static char __pyx_k_timer_100_locals_wrapper[] = "timer_100..wrapper"; +static char __pyx_k_timer_10k_locals_wrapper[] = "timer_10k..wrapper"; +static char __pyx_k_timer_trials_benchmark_10[] = "timer_trials_benchmark_10"; +static char __pyx_k_timer_trials_benchmark_1k[] = "timer_trials_benchmark_1k"; +static char __pyx_k_timer_trials_benchmark_1m[] = "timer_trials_benchmark_1m"; +static char __pyx_k_timer_trials_benchmark_100[] = "timer_trials_benchmark_100"; +static char __pyx_k_timer_trials_benchmark_10k[] = "timer_trials_benchmark_10k"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/benchmarking.pyx"; +static char __pyx_k_lib_Naked_toolshed_c_benchmarkin[] = "lib.Naked.toolshed.c.benchmarking"; +static char __pyx_k_timer_trials_benchmark_100_local[] = "timer_trials_benchmark_100..wrapper"; +static char __pyx_k_timer_trials_benchmark_10_locals[] = "timer_trials_benchmark_10..wrapper"; +static char __pyx_k_timer_trials_benchmark_10k_local[] = "timer_trials_benchmark_10k..wrapper"; +static char __pyx_k_timer_trials_benchmark_1k_locals[] = "timer_trials_benchmark_1k..wrapper"; +static char __pyx_k_timer_trials_benchmark_1m_locals[] = "timer_trials_benchmark_1m..wrapper"; +static char __pyx_k_timer_trials_benchmark_locals_wr[] = "timer_trials_benchmark..wrapper"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_L; +static PyObject *__pyx_kp_s_Mean_for; +static PyObject *__pyx_kp_s_Mean_per_repetition; +static PyObject *__pyx_kp_s_Ratio; +static PyObject *__pyx_kp_s_Standard_Deviation; +static PyObject *__pyx_kp_s_Starting; +static PyObject *__pyx_kp_s_Starting_timed_trials_of; +static PyObject *__pyx_kp_s_Trial; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__16; +static PyObject *__pyx_kp_s__17; +static PyObject *__pyx_kp_s__19; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__20; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_benchmark_list; +static PyObject *__pyx_n_s_collect; +static PyObject *__pyx_n_s_disable; +static PyObject *__pyx_n_s_enable; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_end2; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_flush; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_functools; +static PyObject *__pyx_n_s_gc; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_ie; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_benchmarkin; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mean; +static PyObject *__pyx_n_s_mean_benchmark; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_of_benchmark_function; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_repetitions; +static PyObject *__pyx_kp_s_repetitions_2; +static PyObject *__pyx_kp_s_repetitions_of; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_result_list; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_kp_s_sec; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start2; +static PyObject *__pyx_n_s_std; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_timer_10; +static PyObject *__pyx_n_s_timer_100; +static PyObject *__pyx_n_s_timer_100_locals_wrapper; +static PyObject *__pyx_n_s_timer_10_locals_wrapper; +static PyObject *__pyx_n_s_timer_10k; +static PyObject *__pyx_n_s_timer_10k_locals_wrapper; +static PyObject *__pyx_n_s_timer_1k; +static PyObject *__pyx_n_s_timer_1k_locals_wrapper; +static PyObject *__pyx_n_s_timer_1m; +static PyObject *__pyx_n_s_timer_1m_locals_wrapper; +static PyObject *__pyx_n_s_timer_locals_wrapper; +static PyObject *__pyx_n_s_timer_trials_benchmark; +static PyObject *__pyx_n_s_timer_trials_benchmark_10; +static PyObject *__pyx_n_s_timer_trials_benchmark_100; +static PyObject *__pyx_n_s_timer_trials_benchmark_100_local; +static PyObject *__pyx_n_s_timer_trials_benchmark_10_locals; +static PyObject *__pyx_n_s_timer_trials_benchmark_10k; +static PyObject *__pyx_n_s_timer_trials_benchmark_10k_local; +static PyObject *__pyx_n_s_timer_trials_benchmark_1k; +static PyObject *__pyx_n_s_timer_trials_benchmark_1k_locals; +static PyObject *__pyx_n_s_timer_trials_benchmark_1m; +static PyObject *__pyx_n_s_timer_trials_benchmark_1m_locals; +static PyObject *__pyx_n_s_timer_trials_benchmark_locals_wr; +static PyObject *__pyx_n_s_trials; +static PyObject *__pyx_n_s_wrapper; +static PyObject *__pyx_n_s_wraps; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_50; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_1000; +static PyObject *__pyx_int_10000; +static PyObject *__pyx_int_100000; +static PyObject *__pyx_int_1000000; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__7; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__61; + +/* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_1timer = {__Pyx_NAMESTR("timer"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_100000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":22 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":23 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":24 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":26 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":27 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":28 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":29 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":30 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":31 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":32 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":33 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":34 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":35 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":20 + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper, 0, __pyx_n_s_timer_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":20 + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":36 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10 = {__Pyx_NAMESTR("timer_10"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_10 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_10") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_10", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":46 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":47 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":48 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":50 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":51 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":52 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":53 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":54 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":55 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":56 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":57 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":58 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":59 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_10", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":44 + * + * def timer_10(func, repetitions=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper, 0, __pyx_n_s_timer_10_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":44 + * + * def timer_10(func, repetitions=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":60 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_100(func, repetitions=100): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100 = {__Pyx_NAMESTR("timer_100"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_100 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_100); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_100") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":65 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":66 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":67 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":69 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":70 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":71 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":72 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":73 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":74 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":75 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":76 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":77 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":78 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_100", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":63 + * + * def timer_100(func, repetitions=100): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper, 0, __pyx_n_s_timer_100_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":63 + * + * def timer_100(func, repetitions=100): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":79 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_1k(func, repetitions=1000): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k = {__Pyx_NAMESTR("timer_1k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_1k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_1000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_1k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_1k", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":84 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":85 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":86 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":88 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":89 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":90 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":91 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":92 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":93 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":94 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":95 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":96 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":97 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_1k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":82 + * + * def timer_1k(func, repetitions=1000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper, 0, __pyx_n_s_timer_1k_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":82 + * + * def timer_1k(func, repetitions=1000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":98 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_10k(func, repetitions=10000): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k = {__Pyx_NAMESTR("timer_10k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_10k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_10000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_10k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_10k", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":103 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":104 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":105 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":107 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":108 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":109 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":110 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":111 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":112 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":113 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":114 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":115 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":116 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_10k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":101 + * + * def timer_10k(func, repetitions=10000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper, 0, __pyx_n_s_timer_10k_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":101 + * + * def timer_10k(func, repetitions=10000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":117 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_1m(func, repetitions=1000000): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m = {__Pyx_NAMESTR("timer_1m"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_1m (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_1000000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_1m") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_1m", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":122 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":123 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":124 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":126 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":127 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":128 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":129 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":130 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":131 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":132 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":133 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":134 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":135 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_1m", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":120 + * + * def timer_1m(func, repetitions=1000000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper, 0, __pyx_n_s_timer_1m_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":120 + * + * def timer_1m(func, repetitions=1000000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":136 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark = {__Pyx_NAMESTR("timer_trials_benchmark"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_100000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":155 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":156 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":157 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":158 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":160 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":161 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":162 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":164 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":165 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":166 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":167 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":168 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":169 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":171 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":172 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":173 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":174 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":175 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":176 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":177 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":178 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":179 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":180 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":181 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":182 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":183 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":184 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":185 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":186 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":187 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":188 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":189 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":190 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":191 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":192 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":193 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":194 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":195 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":197 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":198 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":199 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":200 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":153 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_locals_wr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":153 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":201 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10 = {__Pyx_NAMESTR("timer_trials_benchmark_10"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_10 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_10); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_10") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_10", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":210 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":211 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":212 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":213 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":215 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":216 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":217 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":219 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":220 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":221 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":222 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":223 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":224 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":226 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":227 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":228 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":229 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":230 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":231 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":232 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":233 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":234 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":235 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":236 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":237 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":238 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":239 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":240 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":241 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":242 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":243 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":244 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":245 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":246 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":247 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":248 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":249 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":250 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":252 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":253 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":254 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":255 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_10", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":208 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_10_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":208 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":256 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100 = {__Pyx_NAMESTR("timer_trials_benchmark_100"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_100 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_100); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_100") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_100", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":261 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":262 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":263 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":264 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":266 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":267 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":268 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":270 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":271 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":272 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":273 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":274 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":275 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":277 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":278 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":279 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":280 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":281 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":282 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":283 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":284 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":285 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":286 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":287 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":288 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":289 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":290 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":291 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":292 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":293 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":294 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":295 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":296 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":297 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":298 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":299 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":300 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":301 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":303 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":304 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":305 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":306 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_100", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":259 + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_100_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":259 + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":307 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k = {__Pyx_NAMESTR("timer_trials_benchmark_1k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_1k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_1000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_1k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_1k", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":312 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":313 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":314 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":315 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":317 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":318 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":319 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":321 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":322 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":323 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":324 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":325 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":326 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":328 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":329 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":330 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":331 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":332 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":333 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":334 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":335 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":336 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":337 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":338 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":339 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":340 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":341 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":342 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":343 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":344 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":345 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":346 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":347 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":348 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":349 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":350 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":351 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":352 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":354 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":355 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":356 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":357 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_1k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":310 + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_1k_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":310 + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":358 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k = {__Pyx_NAMESTR("timer_trials_benchmark_10k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_10k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_10000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_10k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_10k", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":363 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":364 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":365 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":366 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":368 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":369 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":370 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":372 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":373 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":374 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":375 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":376 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":377 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":379 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":380 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":381 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":382 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":383 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":384 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":385 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":386 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":387 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":388 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":389 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":390 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":391 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":392 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":393 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":394 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":395 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":396 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":397 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":398 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":399 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":400 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":401 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":402 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":403 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":405 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":406 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":407 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":408 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_10k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":361 + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_10k_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":361 + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":409 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m = {__Pyx_NAMESTR("timer_trials_benchmark_1m"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_1m (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_1000000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_1m") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_1m", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":414 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":415 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":416 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":417 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":419 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":420 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":421 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":423 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":424 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":425 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":426 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":427 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":428 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":430 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":431 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":432 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":433 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":434 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":435 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":436 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":437 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":438 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":439 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":440 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":441 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":442 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":443 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":444 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":445 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":446 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":447 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":448 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":449 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":450 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":451 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":452 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":453 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":454 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":456 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":457 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":458 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":459 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_1m", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":412 + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_1m_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":412 + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":460 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct__timer"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_1_timer_10"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_2_timer_100"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_3_timer_1k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_4_timer_10k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_5_timer_1m"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_6_timer_trials_benchmark"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_7_timer_trials_benchmark_10"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_8_timer_trials_benchmark_100"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_9_timer_trials_benchmark_1k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_10_timer_trials_benchmark_10k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_11_timer_trials_benchmark_1m"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("benchmarking"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1}, + {&__pyx_kp_s_Mean_for, __pyx_k_Mean_for, sizeof(__pyx_k_Mean_for), 0, 0, 1, 0}, + {&__pyx_kp_s_Mean_per_repetition, __pyx_k_Mean_per_repetition, sizeof(__pyx_k_Mean_per_repetition), 0, 0, 1, 0}, + {&__pyx_kp_s_Ratio, __pyx_k_Ratio, sizeof(__pyx_k_Ratio), 0, 0, 1, 0}, + {&__pyx_kp_s_Standard_Deviation, __pyx_k_Standard_Deviation, sizeof(__pyx_k_Standard_Deviation), 0, 0, 1, 0}, + {&__pyx_kp_s_Starting, __pyx_k_Starting, sizeof(__pyx_k_Starting), 0, 0, 1, 0}, + {&__pyx_kp_s_Starting_timed_trials_of, __pyx_k_Starting_timed_trials_of, sizeof(__pyx_k_Starting_timed_trials_of), 0, 0, 1, 0}, + {&__pyx_kp_s_Trial, __pyx_k_Trial, sizeof(__pyx_k_Trial), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0}, + {&__pyx_kp_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 0}, + {&__pyx_kp_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_benchmark_list, __pyx_k_benchmark_list, sizeof(__pyx_k_benchmark_list), 0, 0, 1, 1}, + {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1}, + {&__pyx_n_s_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 0, 1, 1}, + {&__pyx_n_s_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_end2, __pyx_k_end2, sizeof(__pyx_k_end2), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_ie, __pyx_k_ie, sizeof(__pyx_k_ie), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_benchmarkin, __pyx_k_lib_Naked_toolshed_c_benchmarkin, sizeof(__pyx_k_lib_Naked_toolshed_c_benchmarkin), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1}, + {&__pyx_n_s_mean_benchmark, __pyx_k_mean_benchmark, sizeof(__pyx_k_mean_benchmark), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_of_benchmark_function, __pyx_k_of_benchmark_function, sizeof(__pyx_k_of_benchmark_function), 0, 0, 1, 0}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_repetitions, __pyx_k_repetitions, sizeof(__pyx_k_repetitions), 0, 0, 1, 1}, + {&__pyx_kp_s_repetitions_2, __pyx_k_repetitions_2, sizeof(__pyx_k_repetitions_2), 0, 0, 1, 0}, + {&__pyx_kp_s_repetitions_of, __pyx_k_repetitions_of, sizeof(__pyx_k_repetitions_of), 0, 0, 1, 0}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_list, __pyx_k_result_list, sizeof(__pyx_k_result_list), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_kp_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start2, __pyx_k_start2, sizeof(__pyx_k_start2), 0, 0, 1, 1}, + {&__pyx_n_s_std, __pyx_k_std, sizeof(__pyx_k_std), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10, __pyx_k_timer_10, sizeof(__pyx_k_timer_10), 0, 0, 1, 1}, + {&__pyx_n_s_timer_100, __pyx_k_timer_100, sizeof(__pyx_k_timer_100), 0, 0, 1, 1}, + {&__pyx_n_s_timer_100_locals_wrapper, __pyx_k_timer_100_locals_wrapper, sizeof(__pyx_k_timer_100_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10_locals_wrapper, __pyx_k_timer_10_locals_wrapper, sizeof(__pyx_k_timer_10_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10k, __pyx_k_timer_10k, sizeof(__pyx_k_timer_10k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10k_locals_wrapper, __pyx_k_timer_10k_locals_wrapper, sizeof(__pyx_k_timer_10k_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1k, __pyx_k_timer_1k, sizeof(__pyx_k_timer_1k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1k_locals_wrapper, __pyx_k_timer_1k_locals_wrapper, sizeof(__pyx_k_timer_1k_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1m, __pyx_k_timer_1m, sizeof(__pyx_k_timer_1m), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1m_locals_wrapper, __pyx_k_timer_1m_locals_wrapper, sizeof(__pyx_k_timer_1m_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_locals_wrapper, __pyx_k_timer_locals_wrapper, sizeof(__pyx_k_timer_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark, __pyx_k_timer_trials_benchmark, sizeof(__pyx_k_timer_trials_benchmark), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10, __pyx_k_timer_trials_benchmark_10, sizeof(__pyx_k_timer_trials_benchmark_10), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_100, __pyx_k_timer_trials_benchmark_100, sizeof(__pyx_k_timer_trials_benchmark_100), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_100_local, __pyx_k_timer_trials_benchmark_100_local, sizeof(__pyx_k_timer_trials_benchmark_100_local), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10_locals, __pyx_k_timer_trials_benchmark_10_locals, sizeof(__pyx_k_timer_trials_benchmark_10_locals), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10k, __pyx_k_timer_trials_benchmark_10k, sizeof(__pyx_k_timer_trials_benchmark_10k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10k_local, __pyx_k_timer_trials_benchmark_10k_local, sizeof(__pyx_k_timer_trials_benchmark_10k_local), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1k, __pyx_k_timer_trials_benchmark_1k, sizeof(__pyx_k_timer_trials_benchmark_1k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1k_locals, __pyx_k_timer_trials_benchmark_1k_locals, sizeof(__pyx_k_timer_trials_benchmark_1k_locals), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1m, __pyx_k_timer_trials_benchmark_1m, sizeof(__pyx_k_timer_trials_benchmark_1m), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1m_locals, __pyx_k_timer_trials_benchmark_1m_locals, sizeof(__pyx_k_timer_trials_benchmark_1m_locals), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_locals_wr, __pyx_k_timer_trials_benchmark_locals_wr, sizeof(__pyx_k_timer_trials_benchmark_locals_wr), 0, 0, 1, 1}, + {&__pyx_n_s_trials, __pyx_k_trials, sizeof(__pyx_k_trials), 0, 0, 1, 1}, + {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":178 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__21 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":233 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__24 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":284 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__27 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":335 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__30 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":386 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__33 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":437 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__36 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_10, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_100, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_1k, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__46 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_10k, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_1m, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_10, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_100, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_1k, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_10k, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_1m, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100000 = PyInt_FromLong(100000L); if (unlikely(!__pyx_int_100000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initbenchmarking(void); /*proto*/ +PyMODINIT_FUNC initbenchmarking(void) +#else +PyMODINIT_FUNC PyInit_benchmarking(void); /*proto*/ +PyMODINIT_FUNC PyInit_benchmarking(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_benchmarking(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("benchmarking"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__benchmarking) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.benchmarking")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.benchmarking", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/benchmarking.pyx":4 + * # encoding: utf-8 + * + * import sys # <<<<<<<<<<<<<< + * import time + * import gc + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":5 + * + * import sys + * import time # <<<<<<<<<<<<<< + * import gc + * from functools import wraps + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":6 + * import sys + * import time + * import gc # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":7 + * import time + * import gc + * from functools import wraps # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wraps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_1timer, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_1k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_10k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_1m, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_1k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_10k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_1m, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":462 + * return wrapper + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.benchmarking", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.benchmarking"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CPYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx new file mode 100644 index 00000000..63878bc0 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx @@ -0,0 +1,463 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import time +import gc +from functools import wraps + +#------------------------------------------------------------------------------ +# [ timer function decorator ] +# runs timed repetitions of the decorated function in a single trial +# default is 100,000 repetitions in the trial +# reports the results of the trial +# Usage example: +# from Naked.toolshed.benchmarking import timer +# @timer +# def myfunction(): +#------------------------------------------------------------------------------ +def timer(func, repetitions=100000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_X function decorators ] +# replicate the above decorator with different number of repetitions +#------------------------------------------------------------------------------ + +def timer_10(func, repetitions=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_100(func, repetitions=100): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1k(func, repetitions=1000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_10k(func, repetitions=10000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1m(func, repetitions=1000000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark decorator function ] +# time a function and compare to a benchmark function +# default is 10 trials x 100,000 repetitions/trial for each function +# Results: +# - Mean of the 10 trials of the test function +# - standard deviation of the 10 trials (if numpy is available) +# - result for 100,000 repetitions of the benchmark function +# - ratio of the test : benchmark function results +# Usage example: +# from Naked.toolshed.benchmarking import timer_trials_benchmark +# @timer_trials_benchmark +# def myfunction(): +#------------------------------------------------------------------------------ +def timer_trials_benchmark(func, repetitions=100000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark_X decorators ] +# additional benchmark decorators that replicate the above function with different # repetitions +#------------------------------------------------------------------------------ +def timer_trials_benchmark_10(func, repetitions=10, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_100(func, repetitions=100, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/build.sh b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/build.sh new file mode 100644 index 00000000..35154d45 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/build.sh @@ -0,0 +1 @@ +python setup.py build_ext --inplace diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.c new file mode 100644 index 00000000..796941b4 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.c @@ -0,0 +1,5294 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:13 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__casts +#define __PYX_HAVE_API__lib__Naked__toolshed__c__casts +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "casts.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +#ifndef CYTHON_PROFILE + #define CYTHON_PROFILE 1 +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL Py_CLEAR(__pyx_frame) + #endif + #define __Pyx_TraceDeclarations \ + static PyCodeObject *__pyx_frame_code = NULL; \ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ + if (unlikely(PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) { \ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ + } + #define __Pyx_TraceException() \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + PyObject *exc_info = __Pyx_GetExceptionTuple(); \ + if (exc_info) { \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + Py_DECREF(exc_info); \ + } \ + tstate->use_tracing = 1; \ + } + #define __Pyx_TraceReturn(result) \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + if (tstate->c_profilefunc) \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + CYTHON_FRAME_DEL; \ + tstate->use_tracing = 1; \ + } + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result) +#endif /* CYTHON_PROFILE */ +#if CYTHON_TRACE + #define __Pyx_TraceLine(lineno) \ + if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + __pyx_frame->f_lineno = lineno; \ + tstate->use_tracing = 0; \ + tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL); \ + tstate->use_tracing = 1; \ + } +#else + #define __Pyx_TraceLine(lineno) +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.casts' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.casts" +int __pyx_module_is_main_lib__Naked__toolshed__c__casts = 0; + +/* Implementation of 'lib.Naked.toolshed.c.casts' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_nob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_2xd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_4xl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_6xq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queue_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_8xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_10xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_12xstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_arg, PyObject *__pyx_v_attributes); /* proto */ +static char __pyx_k_2[] = "2"; +static char __pyx_k_e[] = "e"; +static char __pyx_k_te[] = "te"; +static char __pyx_k_xd[] = "xd"; +static char __pyx_k_xl[] = "xl"; +static char __pyx_k_xq[] = "xq"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_nob[] = "nob"; +static char __pyx_k_XSet[] = "XSet"; +static char __pyx_k_arg1[] = "arg1"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_test[] = "test"; +static char __pyx_k_xset[] = "xset"; +static char __pyx_k_xstr[] = "xstr"; +static char __pyx_k_XDict[] = "XDict"; +static char __pyx_k_XFSet[] = "XFSet"; +static char __pyx_k_XList[] = "XList"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_xfset[] = "xfset"; +static char __pyx_k_A_test[] = "A test"; +static char __pyx_k_XQueue[] = "XQueue"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_test_2[] = "__test__"; +static char __pyx_k_XString[] = "XString"; +static char __pyx_k_set_arg[] = "set_arg"; +static char __pyx_k_list_arg[] = "list_arg"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_queue_arg[] = "queue_arg"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_attributes[] = "attributes"; +static char __pyx_k_string_arg[] = "string_arg"; +static char __pyx_k_NakedObject[] = "NakedObject"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_dictionary_arg[] = "dictionary_arg"; +static char __pyx_k_Naked_toolshed_c_types[] = "Naked.toolshed.c.types"; +static char __pyx_k_lib_Naked_toolshed_c_casts[] = "lib.Naked.toolshed.c.casts"; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/casts.pyx"; +static char __pyx_k_Attempted_to_cast_to_a_XDict_wit[] = "Attempted to cast to a XDict with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XList_wit[] = "Attempted to cast to a XList with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XQueue_wi[] = "Attempted to cast to a XQueue with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XSet_with[] = "Attempted to cast to a XSet with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XString_w[] = "Attempted to cast to a XString with an incompatible type"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py)."; +static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_A_test; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XDict_wit; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XList_wit; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XQueue_wi; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XSet_with; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XString_w; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_NakedObject; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_c_types; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s_XDict; +static PyObject *__pyx_n_s_XFSet; +static PyObject *__pyx_n_s_XList; +static PyObject *__pyx_n_s_XQueue; +static PyObject *__pyx_n_s_XSet; +static PyObject *__pyx_n_s_XString; +static PyObject *__pyx_n_s_arg1; +static PyObject *__pyx_n_s_attributes; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_dictionary_arg; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_casts; +static PyObject *__pyx_n_s_list_arg; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_nob; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_queue_arg; +static PyObject *__pyx_n_s_set_arg; +static PyObject *__pyx_n_s_string_arg; +static PyObject *__pyx_n_s_te; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_2; +static PyObject *__pyx_n_s_xd; +static PyObject *__pyx_n_s_xfset; +static PyObject *__pyx_n_s_xl; +static PyObject *__pyx_n_s_xq; +static PyObject *__pyx_n_s_xset; +static PyObject *__pyx_n_s_xstr; +static PyObject *__pyx_k_; +static PyObject *__pyx_k__2; +static PyObject *__pyx_k__4; +static PyObject *__pyx_k__6; +static PyObject *__pyx_k__8; +static PyObject *__pyx_k__10; +static PyObject *__pyx_k__12; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__19; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; + +/* "lib/Naked/toolshed/c/casts.pyx":5 + * # cython: profile=True + * + * cdef inline int increment(object iterable, object test_string): # <<<<<<<<<<<<<< + * cdef int count = 0 + * cdef object thing + */ + +static CYTHON_INLINE int __pyx_f_3lib_5Naked_8toolshed_1c_5casts_increment(PyObject *__pyx_v_iterable, PyObject *__pyx_v_test_string) { + int __pyx_v_count; + PyObject *__pyx_v_thing = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("increment", 0); + __Pyx_TraceCall("increment", __pyx_f[0], 5); + + /* "lib/Naked/toolshed/c/casts.pyx":6 + * + * cdef inline int increment(object iterable, object test_string): + * cdef int count = 0 # <<<<<<<<<<<<<< + * cdef object thing + * for thing in iterable: + */ + __pyx_v_count = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":8 + * cdef int count = 0 + * cdef object thing + * for thing in iterable: # <<<<<<<<<<<<<< + * if thing == test_string: + * count += 1 + */ + if (PyList_CheckExact(__pyx_v_iterable) || PyTuple_CheckExact(__pyx_v_iterable)) { + __pyx_t_1 = __pyx_v_iterable; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_iterable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_thing, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":9 + * cdef object thing + * for thing in iterable: + * if thing == test_string: # <<<<<<<<<<<<<< + * count += 1 + * return count + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_thing, __pyx_v_test_string, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/casts.pyx":10 + * for thing in iterable: + * if thing == test_string: + * count += 1 # <<<<<<<<<<<<<< + * return count + * + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":11 + * if thing == test_string: + * count += 1 + * return count # <<<<<<<<<<<<<< + * + * from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString + */ + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/casts.pyx":5 + * # cython: profile=True + * + * cdef inline int increment(object iterable, object test_string): # <<<<<<<<<<<<<< + * cdef int count = 0 + * cdef object thing + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("lib.Naked.toolshed.c.casts.increment", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_thing); + __Pyx_TraceReturn(Py_None); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_1nob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_1nob = {__Pyx_NAMESTR("nob"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_1nob, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_1nob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nob (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_attributes,0}; + PyObject* values[1] = {0}; + values[0] = __pyx_k_; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nob") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_attributes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("nob", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.nob", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_nob(__pyx_self, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_nob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("nob", 0); + __Pyx_TraceCall("nob", __pyx_f[0], 20); + + /* "lib/Naked/toolshed/c/casts.pyx":21 + * #------------------------------------------------------------------------------ + * def nob(attributes={}): + * try: # <<<<<<<<<<<<<< + * return NakedObject(attributes) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":22 + * def nob(attributes={}): + * try: + * return NakedObject(attributes) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":23 + * try: + * return NakedObject(attributes) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.nob", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":24 + * return NakedObject(attributes) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":25 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/casts.pyx":26 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.nob", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_3xd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_3xd = {__Pyx_NAMESTR("xd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_3xd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_3xd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dictionary_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dictionary_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__2; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dictionary_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dictionary_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_2xd(__pyx_self, __pyx_v_dictionary_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_2xd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xd", 0); + __Pyx_TraceCall("xd", __pyx_f[0], 32); + + /* "lib/Naked/toolshed/c/casts.pyx":33 + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XDict(dictionary_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":34 + * def xd(dictionary_arg, attributes={}): + * try: + * return XDict(dictionary_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XDict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dictionary_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dictionary_arg); + __Pyx_GIVEREF(__pyx_v_dictionary_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":35 + * try: + * return XDict(dictionary_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":36 + * return XDict(dictionary_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":37 + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":38 + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":39 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":40 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_5xl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_5xl = {__Pyx_NAMESTR("xl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_5xl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_5xl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_list_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xl (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_list_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__4; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_list_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xl", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_4xl(__pyx_self, __pyx_v_list_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_4xl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xl", 0); + __Pyx_TraceCall("xl", __pyx_f[0], 46); + + /* "lib/Naked/toolshed/c/casts.pyx":47 + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XList(list_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":48 + * def xl(list_arg, attributes={}): + * try: + * return XList(list_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_list_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_list_arg); + __Pyx_GIVEREF(__pyx_v_list_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":49 + * try: + * return XList(list_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XList with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":50 + * return XList(list_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":51 + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":52 + * raise TypeError("Attempted to cast to a XList with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":53 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":54 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_7xq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_7xq = {__Pyx_NAMESTR("xq"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_7xq, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_7xq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_queue_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xq (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queue_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__6; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_queue_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xq", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_6xq(__pyx_self, __pyx_v_queue_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_6xq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queue_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xq", 0); + __Pyx_TraceCall("xq", __pyx_f[0], 60); + + /* "lib/Naked/toolshed/c/casts.pyx":61 + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XQueue(queue_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":62 + * def xq(queue_arg, attributes={}): + * try: + * return XQueue(queue_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XQueue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_queue_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_queue_arg); + __Pyx_GIVEREF(__pyx_v_queue_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":63 + * try: + * return XQueue(queue_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":64 + * return XQueue(queue_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":65 + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":66 + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":67 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":68 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_9xset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_9xset = {__Pyx_NAMESTR("xset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_9xset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_9xset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_set_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_set_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__8; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_set_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xset", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_8xset(__pyx_self, __pyx_v_set_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_8xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xset", 0); + __Pyx_TraceCall("xset", __pyx_f[0], 74); + + /* "lib/Naked/toolshed/c/casts.pyx":75 + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XSet(set_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":76 + * def xset(set_arg, attributes={}): + * try: + * return XSet(set_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSet); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_set_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_set_arg); + __Pyx_GIVEREF(__pyx_v_set_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":77 + * try: + * return XSet(set_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":78 + * return XSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":79 + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":80 + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":81 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":82 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_11xfset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_11xfset = {__Pyx_NAMESTR("xfset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_11xfset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_11xfset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_set_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xfset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_set_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__10; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xfset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_set_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xfset", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_10xfset(__pyx_self, __pyx_v_set_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_10xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xfset", 0); + __Pyx_TraceCall("xfset", __pyx_f[0], 88); + + /* "lib/Naked/toolshed/c/casts.pyx":89 + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XFSet(set_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":90 + * def xfset(set_arg, attributes={}): + * try: + * return XFSet(set_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XFSet); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_set_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_set_arg); + __Pyx_GIVEREF(__pyx_v_set_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":91 + * try: + * return XFSet(set_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":92 + * return XFSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":93 + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":94 + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":95 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":96 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_13xstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_13xstr = {__Pyx_NAMESTR("xstr"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_13xstr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_13xstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_string_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xstr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__12; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xstr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_string_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xstr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_12xstr(__pyx_self, __pyx_v_string_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_12xstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_arg, PyObject *__pyx_v_attributes) { + CYTHON_UNUSED PyObject *__pyx_v_te = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xstr", 0); + __Pyx_TraceCall("xstr", __pyx_f[0], 102); + + /* "lib/Naked/toolshed/c/casts.pyx":103 + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XString(string_arg, attributes) + * except TypeError as te: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":104 + * def xstr(string_arg, attributes={}): + * try: + * return XString(string_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XString); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_string_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_string_arg); + __Pyx_GIVEREF(__pyx_v_string_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":105 + * try: + * return XString(string_arg, attributes) + * except TypeError as te: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XString with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_te = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":106 + * return XString(string_arg, attributes) + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":107 + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":108 + * raise TypeError("Attempted to cast to a XString with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":109 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":110 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_te); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("casts"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_A_test, __pyx_k_A_test, sizeof(__pyx_k_A_test), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XDict_wit, __pyx_k_Attempted_to_cast_to_a_XDict_wit, sizeof(__pyx_k_Attempted_to_cast_to_a_XDict_wit), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XList_wit, __pyx_k_Attempted_to_cast_to_a_XList_wit, sizeof(__pyx_k_Attempted_to_cast_to_a_XList_wit), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XQueue_wi, __pyx_k_Attempted_to_cast_to_a_XQueue_wi, sizeof(__pyx_k_Attempted_to_cast_to_a_XQueue_wi), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XSet_with, __pyx_k_Attempted_to_cast_to_a_XSet_with, sizeof(__pyx_k_Attempted_to_cast_to_a_XSet_with), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XString_w, __pyx_k_Attempted_to_cast_to_a_XString_w, sizeof(__pyx_k_Attempted_to_cast_to_a_XString_w), 0, 0, 1, 0}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_c_types, __pyx_k_Naked_toolshed_c_types, sizeof(__pyx_k_Naked_toolshed_c_types), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s_XDict, __pyx_k_XDict, sizeof(__pyx_k_XDict), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet, __pyx_k_XFSet, sizeof(__pyx_k_XFSet), 0, 0, 1, 1}, + {&__pyx_n_s_XList, __pyx_k_XList, sizeof(__pyx_k_XList), 0, 0, 1, 1}, + {&__pyx_n_s_XQueue, __pyx_k_XQueue, sizeof(__pyx_k_XQueue), 0, 0, 1, 1}, + {&__pyx_n_s_XSet, __pyx_k_XSet, sizeof(__pyx_k_XSet), 0, 0, 1, 1}, + {&__pyx_n_s_XString, __pyx_k_XString, sizeof(__pyx_k_XString), 0, 0, 1, 1}, + {&__pyx_n_s_arg1, __pyx_k_arg1, sizeof(__pyx_k_arg1), 0, 0, 1, 1}, + {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_dictionary_arg, __pyx_k_dictionary_arg, sizeof(__pyx_k_dictionary_arg), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_casts, __pyx_k_lib_Naked_toolshed_c_casts, sizeof(__pyx_k_lib_Naked_toolshed_c_casts), 0, 0, 1, 1}, + {&__pyx_n_s_list_arg, __pyx_k_list_arg, sizeof(__pyx_k_list_arg), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_nob, __pyx_k_nob, sizeof(__pyx_k_nob), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_queue_arg, __pyx_k_queue_arg, sizeof(__pyx_k_queue_arg), 0, 0, 1, 1}, + {&__pyx_n_s_set_arg, __pyx_k_set_arg, sizeof(__pyx_k_set_arg), 0, 0, 1, 1}, + {&__pyx_n_s_string_arg, __pyx_k_string_arg, sizeof(__pyx_k_string_arg), 0, 0, 1, 1}, + {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1}, + {&__pyx_n_s_xd, __pyx_k_xd, sizeof(__pyx_k_xd), 0, 0, 1, 1}, + {&__pyx_n_s_xfset, __pyx_k_xfset, sizeof(__pyx_k_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_xl, __pyx_k_xl, sizeof(__pyx_k_xl), 0, 0, 1, 1}, + {&__pyx_n_s_xq, __pyx_k_xq, sizeof(__pyx_k_xq), 0, 0, 1, 1}, + {&__pyx_n_s_xset, __pyx_k_xset, sizeof(__pyx_k_xset), 0, 0, 1, 1}, + {&__pyx_n_s_xstr, __pyx_k_xstr, sizeof(__pyx_k_xstr), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/casts.pyx":36 + * return XDict(dictionary_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XDict_wit); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/casts.pyx":50 + * return XList(list_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XList_wit); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/casts.pyx":64 + * return XQueue(queue_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XQueue_wi); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/casts.pyx":78 + * return XSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XSet_with); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/casts.pyx":92 + * return XFSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XSet_with); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/casts.pyx":106 + * return XString(string_arg, attributes) + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XString_w); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_nob, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_dictionary_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xd, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + __pyx_tuple__18 = PyTuple_Pack(3, __pyx_n_s_list_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xl, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_queue_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xq, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_set_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xset, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_set_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xfset, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_string_arg, __pyx_n_s_attributes, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xstr, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcasts(void); /*proto*/ +PyMODINIT_FUNC initcasts(void) +#else +PyMODINIT_FUNC PyInit_casts(void); /*proto*/ +PyMODINIT_FUNC PyInit_casts(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_casts(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("casts"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__casts) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.casts")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.casts", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/casts.pyx":13 + * return count + * + * from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NakedObject); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NakedObject); + __Pyx_GIVEREF(__pyx_n_s_NakedObject); + __Pyx_INCREF(__pyx_n_s_XFSet); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_XFSet); + __Pyx_GIVEREF(__pyx_n_s_XFSet); + __Pyx_INCREF(__pyx_n_s_XDict); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_XDict); + __Pyx_GIVEREF(__pyx_n_s_XDict); + __Pyx_INCREF(__pyx_n_s_XList); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_XList); + __Pyx_GIVEREF(__pyx_n_s_XList); + __Pyx_INCREF(__pyx_n_s_XQueue); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_XQueue); + __Pyx_GIVEREF(__pyx_n_s_XQueue); + __Pyx_INCREF(__pyx_n_s_XSet); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_XSet); + __Pyx_GIVEREF(__pyx_n_s_XSet); + __Pyx_INCREF(__pyx_n_s_XString); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_XString); + __Pyx_GIVEREF(__pyx_n_s_XString); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_c_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NakedObject, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XFSet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XFSet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XDict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XList, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XQueue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XQueue, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XSet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XString, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":14 + * + * from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_ = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_1nob, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nob, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_3xd, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__4 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_5xl, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_7xq, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__8 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_9xset, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__10 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_11xfset, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xfset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__12 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_13xstr, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xstr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":112 + * raise e + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * test = xstr("A test", {'arg1': '2'}) + * print(test) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/casts.pyx":113 + * + * if __name__ == '__main__': + * test = xstr("A test", {'arg1': '2'}) # <<<<<<<<<<<<<< + * print(test) + * print(test[0]) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_xstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arg1, __pyx_kp_s_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_A_test); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_A_test); + __Pyx_GIVEREF(__pyx_kp_s_A_test); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":114 + * if __name__ == '__main__': + * test = xstr("A test", {'arg1': '2'}) + * print(test) # <<<<<<<<<<<<<< + * print(test[0]) + * print(test.arg1) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":115 + * test = xstr("A test", {'arg1': '2'}) + * print(test) + * print(test[0]) # <<<<<<<<<<<<<< + * print(test.arg1) + * print(type(test)) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":116 + * print(test) + * print(test[0]) + * print(test.arg1) # <<<<<<<<<<<<<< + * print(type(test)) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arg1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":117 + * print(test[0]) + * print(test.arg1) + * print(type(test)) # <<<<<<<<<<<<<< + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PrintOne(0, ((PyObject *)Py_TYPE(__pyx_t_2))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/casts.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=True + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.casts", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.casts"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + const char *funcname, + const char *srcfile, + int firstlineno) { + int retval; + PyThreadState* tstate = PyThreadState_GET(); + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + (*frame)->f_lineno = firstlineno; + tstate->use_tracing = 0; + #if CYTHON_TRACE + if (tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL); + if (!tstate->c_profilefunc) + retval = 1; + else + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + tstate->use_tracing = (tstate->c_profilefunc || + (CYTHON_TRACE && tstate->c_tracefunc)); + return tstate->use_tracing && retval; +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + PyCodeObject *py_code = 0; + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + py_srcfile = PyString_FromString(srcfile); + #else + py_funcname = PyUnicode_FromString(funcname); + py_srcfile = PyUnicode_FromString(srcfile); + #endif + if (!py_funcname | !py_srcfile) goto bad; + py_code = PyCode_New( + 0, /*int argcount,*/ + #if PY_MAJOR_VERSION >= 3 + 0, /*int kwonlyargcount,*/ + #endif + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return py_code; +} +#endif /* CYTHON_PROFILE */ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.pyx new file mode 100644 index 00000000..9b532461 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/casts.pyx @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=True + +cdef inline int increment(object iterable, object test_string): + cdef int count = 0 + cdef object thing + for thing in iterable: + if thing == test_string: + count += 1 + return count + +from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ nob ] (NakedObject) +# Cast a dictionary of attributes to a NakedObject with key>attribute mapping +#------------------------------------------------------------------------------ +def nob(attributes={}): + try: + return NakedObject(attributes) + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xd function ] (XDict) +# Cast a Python dictionary to a XDict +#------------------------------------------------------------------------------ +def xd(dictionary_arg, attributes={}): + try: + return XDict(dictionary_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XDict with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xl function ] (XList) +# Cast a Python list, set, or tuple to a XList +#------------------------------------------------------------------------------ +def xl(list_arg, attributes={}): + try: + return XList(list_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XList with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xq function ] (XQueue) +# Cast a Python list, set, tuple to a XQueue +#------------------------------------------------------------------------------ +def xq(queue_arg, attributes={}): + try: + return XQueue(queue_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XQueue with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xset function ] (XSet) +# Cast a Python set to a XSet +#------------------------------------------------------------------------------ +def xset(set_arg, attributes={}): + try: + return XSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xfset function ] (XFSet) +# Cast a Python set to a XFSet +#------------------------------------------------------------------------------ +def xfset(set_arg, attributes={}): + try: + return XFSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xstr function ] (XString) +# Cast a Python string to a XString +#------------------------------------------------------------------------------ +def xstr(string_arg, attributes={}): + try: + return XString(string_arg, attributes) + except TypeError as te: + raise TypeError("Attempted to cast to a XString with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + raise e + +if __name__ == '__main__': + test = xstr("A test", {'arg1': '2'}) + print(test) + print(test[0]) + print(test.arg1) + print(type(test)) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.c new file mode 100644 index 00000000..249536fa --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.c @@ -0,0 +1,3202 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__cstate +#define __PYX_HAVE_API__lib__Naked__toolshed__c__cstate +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "cstate.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.cstate' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.cstate" +int __pyx_module_is_main_lib__Naked__toolshed__c__cstate = 0; + +/* Implementation of 'lib.Naked.toolshed.c.cstate' */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6cstate_11StateObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_[] = "~"; +static char __pyx_k__3[] = "*"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_py[] = "py"; +static char __pyx_k_cwd[] = "cwd"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_now[] = "now"; +static char __pyx_k_py2[] = "py2"; +static char __pyx_k_py3[] = "py3"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_path[] = "path"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_py2[] = "is_py2"; +static char __pyx_k_is_py3[] = "is_py3"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_pardir[] = "pardir"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_defpath[] = "defpath"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_platform[] = "platform"; +static char __pyx_k_py_major[] = "py_major"; +static char __pyx_k_py_minor[] = "py_minor"; +static char __pyx_k_py_patch[] = "py_patch"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_user_path[] = "user_path"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_expanduser[] = "expanduser"; +static char __pyx_k_parent_dir[] = "parent_dir"; +static char __pyx_k_StateObject[] = "StateObject"; +static char __pyx_k_default_path[] = "default_path"; +static char __pyx_k_file_encoding[] = "file_encoding"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_string_encoding[] = "string_encoding"; +static char __pyx_k_py_major_version[] = "py_major_version"; +static char __pyx_k_py_minor_version[] = "py_minor_version"; +static char __pyx_k_py_patch_version[] = "py_patch_version"; +static char __pyx_k_StateObject___init[] = "StateObject.__init__"; +static char __pyx_k_getdefaultencoding[] = "getdefaultencoding"; +static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; +static char __pyx_k_Naked_toolshed_c_python[] = "Naked.toolshed.c.python"; +static char __pyx_k_Naked_toolshed_c_system[] = "Naked.toolshed.c.system"; +static char __pyx_k_lib_Naked_toolshed_c_cstate[] = "lib.Naked.toolshed.c.cstate"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/cstate.pyx"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_c_python; +static PyObject *__pyx_n_s_Naked_toolshed_c_system; +static PyObject *__pyx_n_s_StateObject; +static PyObject *__pyx_n_s_StateObject___init; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s__3; +static PyObject *__pyx_n_s_cwd; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_default_path; +static PyObject *__pyx_n_s_defpath; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_expanduser; +static PyObject *__pyx_n_s_file_encoding; +static PyObject *__pyx_n_s_getdefaultencoding; +static PyObject *__pyx_n_s_getfilesystemencoding; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_is_py2; +static PyObject *__pyx_n_s_is_py3; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_cstate; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_pardir; +static PyObject *__pyx_n_s_parent_dir; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_platform; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_py; +static PyObject *__pyx_n_s_py2; +static PyObject *__pyx_n_s_py3; +static PyObject *__pyx_n_s_py_major; +static PyObject *__pyx_n_s_py_major_version; +static PyObject *__pyx_n_s_py_minor; +static PyObject *__pyx_n_s_py_minor_version; +static PyObject *__pyx_n_s_py_patch; +static PyObject *__pyx_n_s_py_patch_version; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_string_encoding; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_user_path; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_codeobj__5; + +/* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6cstate_11StateObject___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6cstate_11StateObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_now = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/cstate.pyx":14 + * class StateObject: + * def __init__(self): + * now = datetime.datetime.now() # <<<<<<<<<<<<<< + * self.py2 = py.is_py2() #truth test Python 2 interpreter + * self.py3 = py.is_py3() #truth test Python 3 interpreter + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_now = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":15 + * def __init__(self): + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter # <<<<<<<<<<<<<< + * self.py3 = py.is_py3() #truth test Python 3 interpreter + * self.py_major = py.py_major_version() #Python major version + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_py2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":16 + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + * self.py3 = py.is_py3() #truth test Python 3 interpreter # <<<<<<<<<<<<<< + * self.py_major = py.py_major_version() #Python major version + * self.py_minor = py.py_minor_version() #Python minor version + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_py3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":17 + * self.py2 = py.is_py2() #truth test Python 2 interpreter + * self.py3 = py.is_py3() #truth test Python 3 interpreter + * self.py_major = py.py_major_version() #Python major version # <<<<<<<<<<<<<< + * self.py_minor = py.py_minor_version() #Python minor version + * self.py_patch = py.py_patch_version() #Python patch version + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_py_major_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py_major, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":18 + * self.py3 = py.is_py3() #truth test Python 3 interpreter + * self.py_major = py.py_major_version() #Python major version + * self.py_minor = py.py_minor_version() #Python minor version # <<<<<<<<<<<<<< + * self.py_patch = py.py_patch_version() #Python patch version + * self.os = sys.platform #user operating system + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_py_minor_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py_minor, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":19 + * self.py_major = py.py_major_version() #Python major version + * self.py_minor = py.py_minor_version() #Python minor version + * self.py_patch = py.py_patch_version() #Python patch version # <<<<<<<<<<<<<< + * self.os = sys.platform #user operating system + * self.cwd = cwd() #current (present) working directory + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_py_patch_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py_patch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":20 + * self.py_minor = py.py_minor_version() #Python minor version + * self.py_patch = py.py_patch_version() #Python patch version + * self.os = sys.platform #user operating system # <<<<<<<<<<<<<< + * self.cwd = cwd() #current (present) working directory + * self.parent_dir = os.pardir + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_platform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":21 + * self.py_patch = py.py_patch_version() #Python patch version + * self.os = sys.platform #user operating system + * self.cwd = cwd() #current (present) working directory # <<<<<<<<<<<<<< + * self.parent_dir = os.pardir + * self.default_path = os.defpath + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cwd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":22 + * self.os = sys.platform #user operating system + * self.cwd = cwd() #current (present) working directory + * self.parent_dir = os.pardir # <<<<<<<<<<<<<< + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pardir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent_dir, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":23 + * self.cwd = cwd() #current (present) working directory + * self.parent_dir = os.pardir + * self.default_path = os.defpath # <<<<<<<<<<<<<< + * self.user_path = os.path.expanduser("~") + * self.string_encoding = sys.getdefaultencoding() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_defpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_default_path, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":24 + * self.parent_dir = os.pardir + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") # <<<<<<<<<<<<<< + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_user_path, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":25 + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") + * self.string_encoding = sys.getdefaultencoding() # <<<<<<<<<<<<<< + * self.file_encoding = sys.getfilesystemencoding() + * self.hour = now.hour + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_string_encoding, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":26 + * self.user_path = os.path.expanduser("~") + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() # <<<<<<<<<<<<<< + * self.hour = now.hour + * self.min = now.minute + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_encoding, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":27 + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() + * self.hour = now.hour # <<<<<<<<<<<<<< + * self.min = now.minute + * self.year = now.year + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hour, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":28 + * self.file_encoding = sys.getfilesystemencoding() + * self.hour = now.hour + * self.min = now.minute # <<<<<<<<<<<<<< + * self.year = now.year + * self.day = now.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_min, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":29 + * self.hour = now.hour + * self.min = now.minute + * self.year = now.year # <<<<<<<<<<<<<< + * self.day = now.day + * self.month = now.month + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_year, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":30 + * self.min = now.minute + * self.year = now.year + * self.day = now.day # <<<<<<<<<<<<<< + * self.month = now.month + * self.second = now.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_day, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":31 + * self.year = now.year + * self.day = now.day + * self.month = now.month # <<<<<<<<<<<<<< + * self.second = now.second + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_month, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":32 + * self.day = now.day + * self.month = now.month + * self.second = now.second # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_second, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.cstate.StateObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_now); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("cstate"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_c_python, __pyx_k_Naked_toolshed_c_python, sizeof(__pyx_k_Naked_toolshed_c_python), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_c_system, __pyx_k_Naked_toolshed_c_system, sizeof(__pyx_k_Naked_toolshed_c_system), 0, 0, 1, 1}, + {&__pyx_n_s_StateObject, __pyx_k_StateObject, sizeof(__pyx_k_StateObject), 0, 0, 1, 1}, + {&__pyx_n_s_StateObject___init, __pyx_k_StateObject___init, sizeof(__pyx_k_StateObject___init), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, + {&__pyx_n_s_cwd, __pyx_k_cwd, sizeof(__pyx_k_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_default_path, __pyx_k_default_path, sizeof(__pyx_k_default_path), 0, 0, 1, 1}, + {&__pyx_n_s_defpath, __pyx_k_defpath, sizeof(__pyx_k_defpath), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_expanduser, __pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 0, 1, 1}, + {&__pyx_n_s_file_encoding, __pyx_k_file_encoding, sizeof(__pyx_k_file_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_is_py2, __pyx_k_is_py2, sizeof(__pyx_k_is_py2), 0, 0, 1, 1}, + {&__pyx_n_s_is_py3, __pyx_k_is_py3, sizeof(__pyx_k_is_py3), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_cstate, __pyx_k_lib_Naked_toolshed_c_cstate, sizeof(__pyx_k_lib_Naked_toolshed_c_cstate), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_pardir, __pyx_k_pardir, sizeof(__pyx_k_pardir), 0, 0, 1, 1}, + {&__pyx_n_s_parent_dir, __pyx_k_parent_dir, sizeof(__pyx_k_parent_dir), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 0, 1, 1}, + {&__pyx_n_s_py2, __pyx_k_py2, sizeof(__pyx_k_py2), 0, 0, 1, 1}, + {&__pyx_n_s_py3, __pyx_k_py3, sizeof(__pyx_k_py3), 0, 0, 1, 1}, + {&__pyx_n_s_py_major, __pyx_k_py_major, sizeof(__pyx_k_py_major), 0, 0, 1, 1}, + {&__pyx_n_s_py_major_version, __pyx_k_py_major_version, sizeof(__pyx_k_py_major_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_minor, __pyx_k_py_minor, sizeof(__pyx_k_py_minor), 0, 0, 1, 1}, + {&__pyx_n_s_py_minor_version, __pyx_k_py_minor_version, sizeof(__pyx_k_py_minor_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_patch, __pyx_k_py_patch, sizeof(__pyx_k_py_patch), 0, 0, 1, 1}, + {&__pyx_n_s_py_patch_version, __pyx_k_py_patch_version, sizeof(__pyx_k_py_patch_version), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_string_encoding, __pyx_k_string_encoding, sizeof(__pyx_k_string_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_user_path, __pyx_k_user_path, sizeof(__pyx_k_user_path), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/cstate.pyx":24 + * self.parent_dir = os.pardir + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") # <<<<<<<<<<<<<< + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_now); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcstate(void); /*proto*/ +PyMODINIT_FUNC initcstate(void) +#else +PyMODINIT_FUNC PyInit_cstate(void); /*proto*/ +PyMODINIT_FUNC PyInit_cstate(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cstate(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cstate"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__cstate) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.cstate")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.cstate", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/cstate.pyx":5 + * # cython: profile=False + * + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * from Naked.toolshed.c.system import cwd + * import Naked.toolshed.c.python as py + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":6 + * + * from Naked.settings import debug as DEBUG_FLAG + * from Naked.toolshed.c.system import cwd # <<<<<<<<<<<<<< + * import Naked.toolshed.c.python as py + * import sys + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_cwd); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_cwd); + __Pyx_GIVEREF(__pyx_n_s_cwd); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_Naked_toolshed_c_system, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_cwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":7 + * from Naked.settings import debug as DEBUG_FLAG + * from Naked.toolshed.c.system import cwd + * import Naked.toolshed.c.python as py # <<<<<<<<<<<<<< + * import sys + * import os + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s__3); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__3); + __Pyx_GIVEREF(__pyx_n_s__3); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_c_python, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":8 + * from Naked.toolshed.c.system import cwd + * import Naked.toolshed.c.python as py + * import sys # <<<<<<<<<<<<<< + * import os + * import datetime + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":9 + * import Naked.toolshed.c.python as py + * import sys + * import os # <<<<<<<<<<<<<< + * import datetime + * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":10 + * import sys + * import os + * import datetime # <<<<<<<<<<<<<< + * + * class StateObject: + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":12 + * import datetime + * + * class StateObject: # <<<<<<<<<<<<<< + * def __init__(self): + * now = datetime.datetime.now() + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_StateObject, __pyx_n_s_StateObject, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_cstate, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__, 0, __pyx_n_s_StateObject___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_cstate, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":12 + * import datetime + * + * class StateObject: # <<<<<<<<<<<<<< + * def __init__(self): + * now = datetime.datetime.now() + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_StateObject, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateObject, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":34 + * self.second = now.second + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/cstate.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.cstate", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.cstate"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.pyx new file mode 100644 index 00000000..64930186 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cstate.pyx @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +from Naked.settings import debug as DEBUG_FLAG +from Naked.toolshed.c.system import cwd +import Naked.toolshed.c.python as py +import sys +import os +import datetime + +class StateObject: + def __init__(self): + now = datetime.datetime.now() + self.py2 = py.is_py2() #truth test Python 2 interpreter + self.py3 = py.is_py3() #truth test Python 3 interpreter + self.py_major = py.py_major_version() #Python major version + self.py_minor = py.py_minor_version() #Python minor version + self.py_patch = py.py_patch_version() #Python patch version + self.os = sys.platform #user operating system + self.cwd = cwd() #current (present) working directory + self.parent_dir = os.pardir + self.default_path = os.defpath + self.user_path = os.path.expanduser("~") + self.string_encoding = sys.getdefaultencoding() + self.file_encoding = sys.getfilesystemencoding() + self.hour = now.hour + self.min = now.minute + self.year = now.year + self.day = now.day + self.month = now.month + self.second = now.second + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cythonize.sh b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cythonize.sh new file mode 100644 index 00000000..9e41c509 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/cythonize.sh @@ -0,0 +1,15 @@ +echo "Cythonizing .pyx files to C files" + +cython benchmarking.pyx +cython casts.pyx +cython file.pyx +cython ink.pyx +cython network.pyx +cython python.pyx +cython shell.pyx +cython cstate.pyx +cython system.pyx +cython types.pyx + + +echo "Cythonization is complete" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.c new file mode 100644 index 00000000..b5ecb220 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.c @@ -0,0 +1,12542 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:13 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__file +#define __PYX_HAVE_API__lib__Naked__toolshed__c__file +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "file.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.file' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.file" +int __pyx_module_is_main_lib__Naked__toolshed__c__file = 0; + +/* Implementation of 'lib.Naked.toolshed.c.file' */ +static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_open; +static PyObject *__pyx_builtin_UnicodeEncodeError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_2IO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_2append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_4append_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_6gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_compression_level); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_8write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_10write_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_the_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_12write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_binary_data); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_14safe_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_16safe_write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_file_data); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_18write_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_2read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_4read_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_6read_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_8readlines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_10readlines_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dev_spec_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_12readlines_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_14read_gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_16read_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_a[] = "a"; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_r[] = "r"; +static char __pyx_k_w[] = "w"; +static char __pyx_k_IO[] = "IO"; +static char __pyx_k_gz[] = ".gz"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_rb[] = "rb"; +static char __pyx_k_ue[] = "ue"; +static char __pyx_k_wb[] = "wb"; +static char __pyx_k_wt[] = "wt"; +static char __pyx_k__13[] = ""; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_ioe[] = "ioe"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_NFKD[] = "NFKD"; +static char __pyx_k_UTF8[] = "UTF8"; +static char __pyx_k_data[] = "data"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_gzip[] = "gzip"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_line[] = "line"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_open[] = "open"; +static char __pyx_k_path[] = "path"; +static char __pyx_k_read[] = "read"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_text[] = "text"; +static char __pyx_k_utf8[] = "utf8"; +static char __pyx_k_UTF_8[] = "UTF-8"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_utf_8[] = "utf_8"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_codecs[] = "codecs"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_exists[] = "exists"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_reader[] = "reader"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_writer[] = "writer"; +static char __pyx_k_IOError[] = "IOError"; +static char __pyx_k_UTF_8_2[] = "UTF_8"; +static char __pyx_k_os_path[] = "os.path"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_read_as[] = "read_as"; +static char __pyx_k_utf_8_2[] = "utf-8"; +static char __pyx_k_appender[] = "appender"; +static char __pyx_k_encoding[] = "encoding"; +static char __pyx_k_endswith[] = "endswith"; +static char __pyx_k_filepath[] = "filepath"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_read_bin[] = "read_bin"; +static char __pyx_k_write_as[] = "write_as"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_IO___init[] = "IO.__init__"; +static char __pyx_k_data_list[] = "data_list"; +static char __pyx_k_file_data[] = "file_data"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_norm_data[] = "norm_data"; +static char __pyx_k_norm_line[] = "norm_line"; +static char __pyx_k_norm_text[] = "norm_text"; +static char __pyx_k_normalize[] = "normalize"; +static char __pyx_k_read_gzip[] = "read_gzip"; +static char __pyx_k_read_utf8[] = "read_utf8"; +static char __pyx_k_readlines[] = "readlines"; +static char __pyx_k_write_bin[] = "write_bin"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_FileReader[] = "FileReader"; +static char __pyx_k_FileWriter[] = "FileWriter"; +static char __pyx_k_bin_reader[] = "bin_reader"; +static char __pyx_k_bin_writer[] = "bin_writer"; +static char __pyx_k_safe_write[] = "safe_write"; +static char __pyx_k_textstring[] = "textstring"; +static char __pyx_k_uni_reader[] = "uni_reader"; +static char __pyx_k_write_utf8[] = "write_utf8"; +static char __pyx_k_append_utf8[] = "append_utf8"; +static char __pyx_k_binary_data[] = "binary_data"; +static char __pyx_k_file_exists[] = "file_exists"; +static char __pyx_k_gzip_reader[] = "gzip_reader"; +static char __pyx_k_gzip_writer[] = "gzip_writer"; +static char __pyx_k_unicodedata[] = "unicodedata"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_readlines_as[] = "readlines_as"; +static char __pyx_k_the_encoding[] = "the_encoding"; +static char __pyx_k_compresslevel[] = "compresslevel"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_readlines_utf8[] = "readlines_utf8"; +static char __pyx_k_safe_write_bin[] = "safe_write_bin"; +static char __pyx_k_system_default[] = "system_default"; +static char __pyx_k_FileReader_read[] = "FileReader.read"; +static char __pyx_k_FileWriter_gzip[] = "FileWriter.gzip"; +static char __pyx_k_FileWriter_write[] = "FileWriter.write"; +static char __pyx_k_FileReader___init[] = "FileReader.__init__"; +static char __pyx_k_FileWriter___init[] = "FileWriter.__init__"; +static char __pyx_k_FileWriter_append[] = "FileWriter.append"; +static char __pyx_k_compression_level[] = "compression_level"; +static char __pyx_k_dev_spec_encoding[] = "dev_spec_encoding"; +static char __pyx_k_FileReader_read_as[] = "FileReader.read_as"; +static char __pyx_k_UnicodeEncodeError[] = "UnicodeEncodeError"; +static char __pyx_k_modified_text_list[] = "modified_text_list"; +static char __pyx_k_FileReader_read_bin[] = "FileReader.read_bin"; +static char __pyx_k_FileWriter_write_as[] = "FileWriter.write_as"; +static char __pyx_k_FileReader_read_gzip[] = "FileReader.read_gzip"; +static char __pyx_k_FileReader_read_utf8[] = "FileReader.read_utf8"; +static char __pyx_k_FileReader_readlines[] = "FileReader.readlines"; +static char __pyx_k_FileWriter_write_bin[] = "FileWriter.write_bin"; +static char __pyx_k_FileWriter_safe_write[] = "FileWriter.safe_write"; +static char __pyx_k_FileWriter_write_utf8[] = "FileWriter.write_utf8"; +static char __pyx_k_Naked_toolshed_system[] = "Naked.toolshed.system"; +static char __pyx_k_FileWriter_append_utf8[] = "FileWriter.append_utf8"; +static char __pyx_k_FileReader_readlines_as[] = "FileReader.readlines_as"; +static char __pyx_k_FileReader_readlines_utf8[] = "FileReader.readlines_utf8"; +static char __pyx_k_FileWriter_safe_write_bin[] = "FileWriter.safe_write_bin"; +static char __pyx_k_lib_Naked_toolshed_c_file[] = "lib.Naked.toolshed.c.file"; +static char __pyx_k_Naked_Framework_Error_Unable_to[] = "Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py)."; +static char __pyx_k_The_file_specified_for_the_text[] = "The file specified for the text append does not exist (Naked.toolshed.file.py:append)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/file.pyx"; +static char __pyx_k_The_text_encoding_was_not_specif[] = "The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as)."; +static char __pyx_k_The_text_file_encoding_was_not_s[] = "The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_2[] = "Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_3[] = "Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_4[] = "Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_5[] = "Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_6[] = "Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_7[] = "Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_8[] = "Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_9[] = "Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)"; +static char __pyx_k_The_file_specified_for_the_text_2[] = "The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_10[] = "Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_11[] = "Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_12[] = "Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_13[] = "Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_14[] = "Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_15[] = "Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_The_text_file_encoding_was_not_s_2[] = "The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as)."; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_FileReader; +static PyObject *__pyx_n_s_FileReader___init; +static PyObject *__pyx_n_s_FileReader_read; +static PyObject *__pyx_n_s_FileReader_read_as; +static PyObject *__pyx_n_s_FileReader_read_bin; +static PyObject *__pyx_n_s_FileReader_read_gzip; +static PyObject *__pyx_n_s_FileReader_read_utf8; +static PyObject *__pyx_n_s_FileReader_readlines; +static PyObject *__pyx_n_s_FileReader_readlines_as; +static PyObject *__pyx_n_s_FileReader_readlines_utf8; +static PyObject *__pyx_n_s_FileWriter; +static PyObject *__pyx_n_s_FileWriter___init; +static PyObject *__pyx_n_s_FileWriter_append; +static PyObject *__pyx_n_s_FileWriter_append_utf8; +static PyObject *__pyx_n_s_FileWriter_gzip; +static PyObject *__pyx_n_s_FileWriter_safe_write; +static PyObject *__pyx_n_s_FileWriter_safe_write_bin; +static PyObject *__pyx_n_s_FileWriter_write; +static PyObject *__pyx_n_s_FileWriter_write_as; +static PyObject *__pyx_n_s_FileWriter_write_bin; +static PyObject *__pyx_n_s_FileWriter_write_utf8; +static PyObject *__pyx_n_s_IO; +static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_IO___init; +static PyObject *__pyx_n_s_NFKD; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_10; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_11; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_12; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_13; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_14; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_15; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_9; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_system; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_kp_s_The_file_specified_for_the_text; +static PyObject *__pyx_kp_s_The_file_specified_for_the_text_2; +static PyObject *__pyx_kp_s_The_text_encoding_was_not_specif; +static PyObject *__pyx_kp_s_The_text_file_encoding_was_not_s; +static PyObject *__pyx_kp_s_The_text_file_encoding_was_not_s_2; +static PyObject *__pyx_n_s_UTF8; +static PyObject *__pyx_kp_s_UTF_8; +static PyObject *__pyx_n_s_UTF_8_2; +static PyObject *__pyx_n_s_UnicodeEncodeError; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__13; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_append_utf8; +static PyObject *__pyx_n_s_appender; +static PyObject *__pyx_n_s_bin_reader; +static PyObject *__pyx_n_s_bin_writer; +static PyObject *__pyx_n_s_binary_data; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_codecs; +static PyObject *__pyx_n_s_compression_level; +static PyObject *__pyx_n_s_compresslevel; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_data_list; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_dev_spec_encoding; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_endswith; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exists; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_file_data; +static PyObject *__pyx_n_s_file_exists; +static PyObject *__pyx_n_s_filepath; +static PyObject *__pyx_kp_s_gz; +static PyObject *__pyx_n_s_gzip; +static PyObject *__pyx_n_s_gzip_reader; +static PyObject *__pyx_n_s_gzip_writer; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_ioe; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_file; +static PyObject *__pyx_n_s_line; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_modified_text_list; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_norm_data; +static PyObject *__pyx_n_s_norm_line; +static PyObject *__pyx_n_s_norm_text; +static PyObject *__pyx_n_s_normalize; +static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_os_path; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_r; +static PyObject *__pyx_n_s_rb; +static PyObject *__pyx_n_s_read; +static PyObject *__pyx_n_s_read_as; +static PyObject *__pyx_n_s_read_bin; +static PyObject *__pyx_n_s_read_gzip; +static PyObject *__pyx_n_s_read_utf8; +static PyObject *__pyx_n_s_reader; +static PyObject *__pyx_n_s_readlines; +static PyObject *__pyx_n_s_readlines_as; +static PyObject *__pyx_n_s_readlines_utf8; +static PyObject *__pyx_n_s_safe_write; +static PyObject *__pyx_n_s_safe_write_bin; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_system_default; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_text; +static PyObject *__pyx_n_s_textstring; +static PyObject *__pyx_n_s_the_encoding; +static PyObject *__pyx_n_s_ue; +static PyObject *__pyx_n_s_uni_reader; +static PyObject *__pyx_n_s_unicodedata; +static PyObject *__pyx_n_s_utf8; +static PyObject *__pyx_n_s_utf_8; +static PyObject *__pyx_kp_s_utf_8_2; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_wb; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_write_as; +static PyObject *__pyx_n_s_write_bin; +static PyObject *__pyx_n_s_write_utf8; +static PyObject *__pyx_n_s_writer; +static PyObject *__pyx_n_s_wt; +static PyObject *__pyx_int_6; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__87; + +/* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.IO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_2IO___init__(__pyx_self, __pyx_v_self, __pyx_v_filepath); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_2IO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/file.pyx":14 + * class IO: + * def __init__(self,filepath): + * self.filepath = filepath # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filepath, __pyx_v_filepath) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.IO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter___init__(__pyx_self, __pyx_v_self, __pyx_v_filepath); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/file.pyx":22 + * class FileWriter(IO): + * def __init__(self, filepath): + * IO.__init__(self, filepath) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append = {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_2append(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_2append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_appender = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "lib/Naked/toolshed/c/file.pyx":30 + * #------------------------------------------------------------------------------ + * def append(self, text): + * try: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":31 + * def append(self, text): + * try: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":32 + * try: + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) # <<<<<<<<<<<<<< + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":33 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") # <<<<<<<<<<<<<< + * with open(self.filepath, 'a') as appender: + * appender.write(text) + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":34 + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: # <<<<<<<<<<<<<< + * appender.write(text) + * except UnicodeEncodeError as ue: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_a); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_a); + __Pyx_GIVEREF(__pyx_n_s_a); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_9); + __pyx_v_appender = __pyx_t_9; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":35 + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: + * appender.write(text) # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * self.append_utf8(text) #try writing as utf-8 + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_appender, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":34 + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: # <<<<<<<<<<<<<< + * appender.write(text) + * except UnicodeEncodeError as ue: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_9); + __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_8) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__2, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":36 + * with open(self.filepath, 'a') as appender: + * appender.write(text) + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * self.append_utf8(text) #try writing as utf-8 + * except Exception as e: + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ue = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":37 + * appender.write(text) + * except UnicodeEncodeError as ue: + * self.append_utf8(text) #try writing as utf-8 # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_append_utf8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":38 + * except UnicodeEncodeError as ue: + * self.append_utf8(text) #try writing as utf-8 + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":39 + * self.append_utf8(text) #try writing as utf-8 + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/file.pyx":40 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L35; + } + __pyx_L35:; + + /* "lib/Naked/toolshed/c/file.pyx":41 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_appender); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8 = {__Pyx_NAMESTR("append_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append_utf8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("append_utf8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append_utf8") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("append_utf8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_4append_utf8(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_4append_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_appender = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":49 + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): + * try: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":50 + * def append_utf8(self, text): + * try: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":51 + * try: + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): # <<<<<<<<<<<<<< + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + * import codecs + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":52 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") # <<<<<<<<<<<<<< + * import codecs + * import unicodedata + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":53 + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + * import codecs # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":54 + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + * import codecs + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_unicodedata = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":55 + * import codecs + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + * appender.write(norm_text) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_norm_text = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":56 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: # <<<<<<<<<<<<<< + * appender.write(norm_text) + * except Exception as e: + */ + /*with:*/ { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_s_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + __Pyx_INCREF(__pyx_t_5); + __pyx_v_appender = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":57 + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + * appender.write(norm_text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_appender, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":56 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: # <<<<<<<<<<<<<< + * appender.write(norm_text) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_9, __pyx_t_5); + __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_10) { + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":58 + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + * appender.write(norm_text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/file.pyx":59 + * appender.write(norm_text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/file.pyx":60 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":61 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_appender); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip = {__Pyx_NAMESTR("gzip"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_compression_level = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gzip (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,&__pyx_n_s_compression_level,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)__pyx_int_6)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("gzip", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression_level); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gzip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + __pyx_v_compression_level = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gzip", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_6gzip(__pyx_self, __pyx_v_self, __pyx_v_text, __pyx_v_compression_level); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_6gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_compression_level) { + PyObject *__pyx_v_gzip = NULL; + PyObject *__pyx_v_gzip_writer = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_binary_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("gzip", 0); + + /* "lib/Naked/toolshed/c/file.pyx":72 + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): + * try: # <<<<<<<<<<<<<< + * import gzip + * if not self.filepath.endswith(".gz"): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":73 + * def gzip(self, text, compression_level=6): + * try: + * import gzip # <<<<<<<<<<<<<< + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_gzip = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":74 + * try: + * import gzip + * if not self.filepath.endswith(".gz"): # <<<<<<<<<<<<<< + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_endswith); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":75 + * import gzip + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" # <<<<<<<<<<<<<< + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(text) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_gz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filepath, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/file.pyx":76 + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compresslevel, __pyx_v_compression_level) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + __Pyx_INCREF(__pyx_t_8); + __pyx_v_gzip_writer = __pyx_t_8; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":77 + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(text) # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * import unicodedata + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":76 + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_9, __pyx_t_8); + __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_10) { + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__8, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":78 + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_ue = __pyx_t_9; + + /* "lib/Naked/toolshed/c/file.pyx":79 + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * import codecs + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_unicodedata = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":80 + * except UnicodeEncodeError as ue: + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write # <<<<<<<<<<<<<< + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_norm_text = __pyx_t_17; + __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":81 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * import codecs # <<<<<<<<<<<<<< + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + */ + __pyx_t_17 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_v_codecs = __pyx_t_17; + __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":82 + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") # <<<<<<<<<<<<<< + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(binary_data) + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_encode); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __Pyx_INCREF(__pyx_n_s_utf_8); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_utf_8); + __Pyx_GIVEREF(__pyx_n_s_utf_8); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_binary_data = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":83 + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(binary_data) + * except Exception as e: + */ + /*with:*/ { + if (unlikely(!__pyx_v_gzip)) { __Pyx_RaiseUnboundLocalError("gzip"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_16 = 0; + __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_compresslevel, __pyx_v_compression_level) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_18, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = __Pyx_PyObject_LookupSpecial(__pyx_t_18, __pyx_n_s_enter); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L33_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L33_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + __Pyx_INCREF(__pyx_t_17); + __Pyx_XDECREF_SET(__pyx_v_gzip_writer, __pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":84 + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(binary_data) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(__pyx_v_binary_data); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_binary_data); + __Pyx_GIVEREF(__pyx_v_binary_data); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L46_try_end; + __pyx_L39_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":83 + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(binary_data) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_18, &__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_16, __pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_6 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ErrRestore(__pyx_t_16, __pyx_t_18, __pyx_t_17); + __pyx_t_16 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L40_exception_handled; + } + __pyx_L41_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11); + goto __pyx_L5_except_error; + __pyx_L40_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11); + __pyx_L46_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_10) { + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__9, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + goto __pyx_L38; + } + __pyx_L38:; + } + goto __pyx_L51; + __pyx_L33_error:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L5_except_error; + __pyx_L51:; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":85 + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(binary_data) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/file.pyx":86 + * gzip_writer.write(binary_data) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":87 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L54; + } + __pyx_L54:; + + /* "lib/Naked/toolshed/c/file.pyx":88 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gzip); + __Pyx_XDECREF(__pyx_v_gzip_writer); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_binary_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_8write(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_8write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_writer = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write", 0); + + /* "lib/Naked/toolshed/c/file.pyx":97 + * #------------------------------------------------------------------------------ + * def write(self, text): + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":98 + * def write(self, text): + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wt); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_wt); + __Pyx_GIVEREF(__pyx_n_s_wt); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_writer = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":99 + * try: + * with open(self.filepath, 'wt') as writer: + * writer.write(text) # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # attempt to write with utf-8 encoding + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":98 + * def write(self, text): + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_7); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L16:; + } + goto __pyx_L29; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3_error; + __pyx_L29:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":100 + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * self.write_utf8(text) # attempt to write with utf-8 encoding + * except Exception as e: + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ue = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":101 + * writer.write(text) + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # attempt to write with utf-8 encoding # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_utf8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":102 + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # attempt to write with utf-8 encoding + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":103 + * self.write_utf8(text) # attempt to write with utf-8 encoding + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":104 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L34; + } + __pyx_L34:; + + /* "lib/Naked/toolshed/c/file.pyx":105 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_writer); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as = {__Pyx_NAMESTR("write_as"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_the_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_as (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,&__pyx_n_s_the_encoding,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s__13)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_as", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_encoding); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_as") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + __pyx_v_the_encoding = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_as", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_10write_as(__pyx_self, __pyx_v_self, __pyx_v_text, __pyx_v_the_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_10write_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_the_encoding) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_as", 0); + + /* "lib/Naked/toolshed/c/file.pyx":113 + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): + * try: # <<<<<<<<<<<<<< + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":114 + * def write_as(self, text, the_encoding=""): + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception # <<<<<<<<<<<<<< + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_the_encoding, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":115 + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":116 + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + * f.write(text) + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":117 + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: # <<<<<<<<<<<<<< + * f.write(text) + * except Exception as e: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_v_the_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":118 + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + * f.write(text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":117 + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: # <<<<<<<<<<<<<< + * f.write(text) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_14 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_8, __pyx_t_7); + __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__15, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":119 + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + * f.write(text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/file.pyx":120 + * f.write(text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":121 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":122 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin = {__Pyx_NAMESTR("write_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_binary_data = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_bin (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_binary_data,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binary_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_bin", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bin") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_binary_data = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_bin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_12write_bin(__pyx_self, __pyx_v_self, __pyx_v_binary_data); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_12write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_binary_data) { + PyObject *__pyx_v_bin_writer = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_bin", 0); + + /* "lib/Naked/toolshed/c/file.pyx":130 + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'wb') as bin_writer: + * bin_writer.write(binary_data) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":131 + * def write_bin(self, binary_data): + * try: + * with open(self.filepath, 'wb') as bin_writer: # <<<<<<<<<<<<<< + * bin_writer.write(binary_data) + * except Exception as e: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_bin_writer = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":132 + * try: + * with open(self.filepath, 'wb') as bin_writer: + * bin_writer.write(binary_data) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_binary_data); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_binary_data); + __Pyx_GIVEREF(__pyx_v_binary_data); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":131 + * def write_bin(self, binary_data): + * try: + * with open(self.filepath, 'wb') as bin_writer: # <<<<<<<<<<<<<< + * bin_writer.write(binary_data) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_7); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__17, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L16:; + } + goto __pyx_L29; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3_error; + __pyx_L29:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":133 + * with open(self.filepath, 'wb') as bin_writer: + * bin_writer.write(binary_data) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":134 + * bin_writer.write(binary_data) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":135 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L32; + } + __pyx_L32:; + + /* "lib/Naked/toolshed/c/file.pyx":136 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bin_writer); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write = {__Pyx_NAMESTR("safe_write"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("safe_write (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("safe_write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "safe_write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("safe_write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_14safe_write(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_14safe_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_writer = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("safe_write", 0); + + /* "lib/Naked/toolshed/c/file.pyx":145 + * #------------------------------------------------------------------------------ + * def safe_write(self, text): + * import os.path # <<<<<<<<<<<<<< + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_os = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":146 + * def safe_write(self, text): + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/file.pyx":147 + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + */ + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":148 + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * return True + */ + /*with:*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_wt); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_wt); + __Pyx_GIVEREF(__pyx_n_s_wt); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_2); + __pyx_v_writer = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":149 + * try: + * with open(self.filepath, 'wt') as writer: + * writer.write(text) # <<<<<<<<<<<<<< + * return True + * except UnicodeEncodeError as ue: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":148 + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * return True + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_2); + __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L4_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__19, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_error; + __pyx_L30:; + } + + /* "lib/Naked/toolshed/c/file.pyx":150 + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + * return True # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * self.write_utf8(text) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L8_try_return; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":151 + * writer.write(text) + * return True + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * self.write_utf8(text) + * return True + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ue = __pyx_t_1; + + /* "lib/Naked/toolshed/c/file.pyx":152 + * return True + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # <<<<<<<<<<<<<< + * return True + * except Exception as e: + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_utf8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":153 + * except UnicodeEncodeError as ue: + * self.write_utf8(text) + * return True # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":154 + * self.write_utf8(text) + * return True + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_e = __pyx_t_1; + + /* "lib/Naked/toolshed/c/file.pyx":155 + * return True + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":156 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * else: + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L35; + } + __pyx_L35:; + + /* "lib/Naked/toolshed/c/file.pyx":157 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * else: + * return False # if file exists, do not write and return False + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L11_try_end:; + } + } + /*else*/ { + + /* "lib/Naked/toolshed/c/file.pyx":159 + * raise e + * else: + * return False # if file exists, do not write and return False # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_writer); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin = {__Pyx_NAMESTR("safe_write_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_file_data = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("safe_write_bin (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_file_data,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("safe_write_bin", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "safe_write_bin") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_file_data = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("safe_write_bin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_16safe_write_bin(__pyx_self, __pyx_v_self, __pyx_v_file_data); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_16safe_write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_file_data) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_writer = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("safe_write_bin", 0); + + /* "lib/Naked/toolshed/c/file.pyx":167 + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): + * try: # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":168 + * def safe_write_bin(self, file_data): + * try: + * import os.path # <<<<<<<<<<<<<< + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":169 + * try: + * import os.path + * if not os.path.exists(self.filepath): # <<<<<<<<<<<<<< + * with open(self.filepath, 'wb') as writer: + * writer.write(file_data) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = ((!__pyx_t_7) != 0); + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/file.pyx":170 + * import os.path + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: # <<<<<<<<<<<<<< + * writer.write(file_data) + * return True + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_5); + __pyx_v_writer = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":171 + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: + * writer.write(file_data) # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_file_data); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_file_data); + __Pyx_GIVEREF(__pyx_v_file_data); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":170 + * import os.path + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: # <<<<<<<<<<<<<< + * writer.write(file_data) + * return True + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_8 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_4, __pyx_t_5); + __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__21, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + + /* "lib/Naked/toolshed/c/file.pyx":172 + * with open(self.filepath, 'wb') as writer: + * writer.write(file_data) + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/file.pyx":174 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":175 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":176 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":177 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":178 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_writer); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8 = {__Pyx_NAMESTR("write_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_utf8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_utf8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_utf8") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_utf8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_18write_utf8(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_18write_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_ioe = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":189 + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): + * try: # <<<<<<<<<<<<<< + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":190 + * def write_utf8(self, text): + * try: + * import codecs # <<<<<<<<<<<<<< + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + * except IOError as ioe: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_codecs = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":191 + * try: + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') # <<<<<<<<<<<<<< + * except IOError as ioe: + * if DEBUG_FLAG: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoding, __pyx_n_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_f = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":192 + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + * except IOError as ioe: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_IOError); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ioe = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":193 + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + * except IOError as ioe: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + * raise ioe + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":194 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":195 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + * raise ioe # <<<<<<<<<<<<<< + * try: + * import unicodedata + */ + __Pyx_Raise(__pyx_v_ioe, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":196 + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + * raise ioe + * try: # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":197 + * raise ioe + * try: + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * f.write(norm_text) + */ + __pyx_t_6 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_unicodedata = __pyx_t_6; + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":198 + * try: + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write # <<<<<<<<<<<<<< + * f.write(norm_text) + * except Exception as e: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_norm_text = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":199 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * f.write(norm_text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":200 + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * f.write(norm_text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":201 + * f.write(norm_text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":202 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L27; + } + __pyx_L27:; + + /* "lib/Naked/toolshed/c/file.pyx":203 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * finally: + * f.close() + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + goto __pyx_L15_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_L24_try_end:; + } + } + + /* "lib/Naked/toolshed/c/file.pyx":205 + * raise e + * finally: + * f.close() # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16; + } + /*exception exit:*/{ + __pyx_L15_error:; + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + __pyx_L29_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + goto __pyx_L1_error; + } + __pyx_L16:; + } + + /* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_ioe); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader___init__(__pyx_self, __pyx_v_self, __pyx_v_filepath); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/file.pyx":214 + * class FileReader(IO): + * def __init__(self, filepath): + * IO.__init__(self, filepath) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read = {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_2read(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_2read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read", 0); + + /* "lib/Naked/toolshed/c/file.pyx":223 + * #------------------------------------------------------------------------------ + * def read(self): + * try: # <<<<<<<<<<<<<< + * return self.read_utf8() #reads everything as unicode in utf8 encoding + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":224 + * def read(self): + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_read_utf8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":225 + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_6) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":226 + * return self.read_utf8() #reads everything as unicode in utf8 encoding + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":227 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":228 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin = {__Pyx_NAMESTR("read_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_bin (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_4read_bin(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_4read_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_bin_reader = NULL; + PyObject *__pyx_v_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_bin", 0); + + /* "lib/Naked/toolshed/c/file.pyx":237 + * #------------------------------------------------------------------------------ + * def read_bin(self): + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'rb') as bin_reader: + * data = bin_reader.read() + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":238 + * def read_bin(self): + * try: + * with open(self.filepath, 'rb') as bin_reader: # <<<<<<<<<<<<<< + * data = bin_reader.read() + * return data + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_bin_reader = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":239 + * try: + * with open(self.filepath, 'rb') as bin_reader: + * data = bin_reader.read() # <<<<<<<<<<<<<< + * return data + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_reader, __pyx_n_s_read); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_data = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":240 + * with open(self.filepath, 'rb') as bin_reader: + * data = bin_reader.read() + * return data # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_data); + __pyx_r = __pyx_v_data; + goto __pyx_L21_try_return; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":238 + * def read_bin(self): + * try: + * with open(self.filepath, 'rb') as bin_reader: # <<<<<<<<<<<<<< + * data = bin_reader.read() + * return data + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_7, __pyx_t_5); + __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__26, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L14_return: { + __pyx_t_10 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_6) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__27, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L7_try_return; + } + __pyx_L16:; + } + goto __pyx_L29; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3_error; + __pyx_L29:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":241 + * data = bin_reader.read() + * return data + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/file.pyx":242 + * return data + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":243 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L32; + } + __pyx_L32:; + + /* "lib/Naked/toolshed/c/file.pyx":244 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bin_reader); + __Pyx_XDECREF(__pyx_v_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as = {__Pyx_NAMESTR("read_as"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_as (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_encoding,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_encoding)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("read_as", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_as") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_the_encoding = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_as", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_6read_as(__pyx_self, __pyx_v_self, __pyx_v_the_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_6read_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_encoding) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_as", 0); + + /* "lib/Naked/toolshed/c/file.pyx":253 + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): + * try: # <<<<<<<<<<<<<< + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":254 + * def read_as(self, the_encoding): + * try: + * if the_encoding == "": # <<<<<<<<<<<<<< + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_the_encoding, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":255 + * try: + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":256 + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + * data = f.read() + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":257 + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: # <<<<<<<<<<<<<< + * data = f.read() + * return data + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_v_the_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":258 + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + * data = f.read() # <<<<<<<<<<<<<< + * return data + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_data = __pyx_t_8; + __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":257 + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: # <<<<<<<<<<<<<< + * data = f.read() + * return data + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_8, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_14 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__30, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + + /* "lib/Naked/toolshed/c/file.pyx":259 + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + * data = f.read() + * return data # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + __Pyx_INCREF(__pyx_v_data); + __pyx_r = __pyx_v_data; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":260 + * data = f.read() + * return data + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/file.pyx":261 + * return data + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":262 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":263 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines = {__Pyx_NAMESTR("readlines"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readlines (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_8readlines(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_8readlines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("readlines", 0); + + /* "lib/Naked/toolshed/c/file.pyx":272 + * #------------------------------------------------------------------------------ + * def readlines(self): + * try: # <<<<<<<<<<<<<< + * return self.readlines_utf8() # read as utf8 encoded file + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":273 + * def readlines(self): + * try: + * return self.readlines_utf8() # read as utf8 encoded file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_readlines_utf8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":274 + * try: + * return self.readlines_utf8() # read as utf8 encoded file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_6) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":275 + * return self.readlines_utf8() # read as utf8 encoded file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":276 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":277 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as = {__Pyx_NAMESTR("readlines_as"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_dev_spec_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readlines_as (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dev_spec_encoding,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev_spec_encoding)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("readlines_as", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readlines_as") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_dev_spec_encoding = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("readlines_as", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_10readlines_as(__pyx_self, __pyx_v_self, __pyx_v_dev_spec_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_10readlines_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dev_spec_encoding) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_reader = NULL; + PyObject *__pyx_v_data_list = NULL; + PyObject *__pyx_v_line = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("readlines_as", 0); + + /* "lib/Naked/toolshed/c/file.pyx":286 + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): + * try: # <<<<<<<<<<<<<< + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":287 + * def readlines_as(self, dev_spec_encoding): + * try: + * if dev_spec_encoding == "": # <<<<<<<<<<<<<< + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_dev_spec_encoding, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":288 + * try: + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":289 + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + * data_list = [] + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":290 + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: # <<<<<<<<<<<<<< + * data_list = [] + * for line in reader: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_v_dev_spec_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_reader = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":291 + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + * data_list = [] # <<<<<<<<<<<<<< + * for line in reader: + * data_list.append(line) + */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_data_list = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":292 + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + * data_list = [] + * for line in reader: # <<<<<<<<<<<<<< + * data_list.append(line) + * return data_list + */ + if (PyList_CheckExact(__pyx_v_reader) || PyTuple_CheckExact(__pyx_v_reader)) { + __pyx_t_7 = __pyx_v_reader; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_reader); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = Py_TYPE(__pyx_t_7)->tp_iternext; + } + for (;;) { + if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_7)) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #endif + } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_7)) { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_14(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":293 + * data_list = [] + * for line in reader: + * data_list.append(line) # <<<<<<<<<<<<<< + * return data_list + * except Exception as e: + */ + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_data_list, __pyx_v_line); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":294 + * for line in reader: + * data_list.append(line) + * return data_list # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_data_list); + __pyx_r = __pyx_v_data_list; + goto __pyx_L22_try_return; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":290 + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: # <<<<<<<<<<<<<< + * data_list = [] + * for line in reader: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_16); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_17 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_17) { + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_6); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L22_try_return:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L15_return; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__34, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L15_return: { + __pyx_t_12 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_9) { + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__35, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L7_try_return; + } + __pyx_L17:; + } + goto __pyx_L32; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L32:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":295 + * data_list.append(line) + * return data_list + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/file.pyx":296 + * return data_list + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_17) { + + /* "lib/Naked/toolshed/c/file.pyx":297 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L35; + } + __pyx_L35:; + + /* "lib/Naked/toolshed/c/file.pyx":298 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_reader); + __Pyx_XDECREF(__pyx_v_data_list); + __Pyx_XDECREF(__pyx_v_line); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8 = {__Pyx_NAMESTR("readlines_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readlines_utf8 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_12readlines_utf8(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_12readlines_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_uni_reader = NULL; + PyObject *__pyx_v_modified_text_list = NULL; + PyObject *__pyx_v_line = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_line = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("readlines_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":307 + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): + * try: # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":308 + * def readlines_utf8(self): + * try: + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + * modified_text_list = [] + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_codecs = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":309 + * try: + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: # <<<<<<<<<<<<<< + * modified_text_list = [] + * for line in uni_reader: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoding, __pyx_kp_s_utf_8_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + __Pyx_INCREF(__pyx_t_6); + __pyx_v_uni_reader = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":310 + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + * modified_text_list = [] # <<<<<<<<<<<<<< + * for line in uni_reader: + * import unicodedata + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_modified_text_list = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":311 + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + * modified_text_list = [] + * for line in uni_reader: # <<<<<<<<<<<<<< + * import unicodedata + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + */ + if (PyList_CheckExact(__pyx_v_uni_reader) || PyTuple_CheckExact(__pyx_v_uni_reader)) { + __pyx_t_6 = __pyx_v_uni_reader; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_uni_reader); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #endif + } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_13(__pyx_t_6); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":312 + * modified_text_list = [] + * for line in uni_reader: + * import unicodedata # <<<<<<<<<<<<<< + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + * modified_text_list.append(norm_line) + */ + __pyx_t_7 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_unicodedata, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":313 + * for line in uni_reader: + * import unicodedata + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use # <<<<<<<<<<<<<< + * modified_text_list.append(norm_line) + * return modified_text_list + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_line); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_line); + __Pyx_GIVEREF(__pyx_v_line); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_norm_line, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":314 + * import unicodedata + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + * modified_text_list.append(norm_line) # <<<<<<<<<<<<<< + * return modified_text_list + * except Exception as e: + */ + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_modified_text_list, __pyx_v_norm_line); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":315 + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + * modified_text_list.append(norm_line) + * return modified_text_list # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_modified_text_list); + __pyx_r = __pyx_v_modified_text_list; + goto __pyx_L21_try_return; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":309 + * try: + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: # <<<<<<<<<<<<<< + * modified_text_list = [] + * for line in uni_reader: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_16 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_17 = ((!(__pyx_t_16 != 0)) != 0); + if (__pyx_t_17) { + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_4, __pyx_t_5); + __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L3_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_8) { + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__37, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + goto __pyx_L16; + } + __pyx_L14_return: { + __pyx_t_11 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_8) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__38, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L7_try_return; + } + __pyx_L16:; + } + goto __pyx_L31; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L3_error; + __pyx_L31:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":316 + * modified_text_list.append(norm_line) + * return modified_text_list + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":317 + * return modified_text_list + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_17) { + + /* "lib/Naked/toolshed/c/file.pyx":318 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L34; + } + __pyx_L34:; + + /* "lib/Naked/toolshed/c/file.pyx":319 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_uni_reader); + __Pyx_XDECREF(__pyx_v_modified_text_list); + __Pyx_XDECREF(__pyx_v_line); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_line); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip = {__Pyx_NAMESTR("read_gzip"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_gzip (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_encoding,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_n_s_system_default)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_gzip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_encoding = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_gzip", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_14read_gzip(__pyx_self, __pyx_v_self, __pyx_v_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_14read_gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_encoding) { + PyObject *__pyx_v_gzip = NULL; + PyObject *__pyx_v_gzip_reader = NULL; + PyObject *__pyx_v_file_data = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_gzip", 0); + + /* "lib/Naked/toolshed/c/file.pyx":330 + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): + * try: # <<<<<<<<<<<<<< + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":331 + * def read_gzip(self, encoding="system_default"): + * try: + * import gzip # <<<<<<<<<<<<<< + * with gzip.open(self.filepath, 'rb') as gzip_reader: + * file_data = gzip_reader.read() + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_gzip = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":332 + * try: + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: # <<<<<<<<<<<<<< + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_4); + __pyx_v_gzip_reader = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":333 + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: + * file_data = gzip_reader.read() # <<<<<<<<<<<<<< + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + * import codecs + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip_reader, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_file_data = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":334 + * with gzip.open(self.filepath, 'rb') as gzip_reader: + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: # <<<<<<<<<<<<<< + * import codecs + * file_data = codecs.decode(file_data, "utf-8") + */ + __Pyx_INCREF(__pyx_v_encoding); + __pyx_t_5 = __pyx_v_encoding; + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_utf_8_2, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + if (!__pyx_t_11) { + __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_utf8, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_11; + } + if (!__pyx_t_13) { + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_utf_8, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) { + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_UTF_8, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_11 = __pyx_t_13; + } else { + __pyx_t_11 = __pyx_t_12; + } + if (!__pyx_t_11) { + __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_UTF8, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_11; + } + if (!__pyx_t_13) { + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_UTF_8_2, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_13; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "lib/Naked/toolshed/c/file.pyx":335 + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + * import codecs # <<<<<<<<<<<<<< + * file_data = codecs.decode(file_data, "utf-8") + * import unicodedata + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":336 + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + * import codecs + * file_data = codecs.decode(file_data, "utf-8") # <<<<<<<<<<<<<< + * import unicodedata + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_file_data); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_file_data); + __Pyx_GIVEREF(__pyx_v_file_data); + __Pyx_INCREF(__pyx_kp_s_utf_8_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_utf_8_2); + __Pyx_GIVEREF(__pyx_kp_s_utf_8_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_file_data, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":337 + * import codecs + * file_data = codecs.decode(file_data, "utf-8") + * import unicodedata # <<<<<<<<<<<<<< + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + * return norm_data + */ + __pyx_t_6 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_unicodedata = __pyx_t_6; + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":338 + * file_data = codecs.decode(file_data, "utf-8") + * import unicodedata + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller # <<<<<<<<<<<<<< + * return norm_data + * else: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_file_data); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_file_data); + __Pyx_GIVEREF(__pyx_v_file_data); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_norm_data = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":339 + * import unicodedata + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + * return norm_data # <<<<<<<<<<<<<< + * else: + * return file_data + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_norm_data); + __pyx_r = __pyx_v_norm_data; + goto __pyx_L21_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/file.pyx":341 + * return norm_data + * else: + * return file_data # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_file_data); + __pyx_r = __pyx_v_file_data; + goto __pyx_L21_try_return; + } + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":332 + * try: + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: # <<<<<<<<<<<<<< + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_12) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_6); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_7) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__40, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L14_return: { + __pyx_t_10 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_7) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__41, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L7_try_return; + } + __pyx_L16:; + } + goto __pyx_L30; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":342 + * else: + * return file_data + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + */ + __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_16) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":343 + * return file_data + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_12) { + + /* "lib/Naked/toolshed/c/file.pyx":344 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":345 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gzip); + __Pyx_XDECREF(__pyx_v_gzip_reader); + __Pyx_XDECREF(__pyx_v_file_data); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8 = {__Pyx_NAMESTR("read_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_utf8 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_16read_utf8(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_16read_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_ioe = NULL; + PyObject *__pyx_v_textstring = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":356 + * #------------------------------------------------------------------------------ + * def read_utf8(self): + * try: # <<<<<<<<<<<<<< + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":357 + * def read_utf8(self): + * try: + * import codecs # <<<<<<<<<<<<<< + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + * except IOError as ioe: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_codecs = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":358 + * try: + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') # <<<<<<<<<<<<<< + * except IOError as ioe: + * if DEBUG_FLAG: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoding, __pyx_n_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_f = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":359 + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + * except IOError as ioe: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_IOError); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ioe = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":360 + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + * except IOError as ioe: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + * raise ioe + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":361 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":362 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + * raise ioe # <<<<<<<<<<<<<< + * try: + * textstring = f.read() + */ + __Pyx_Raise(__pyx_v_ioe, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":363 + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + * raise ioe + * try: # <<<<<<<<<<<<<< + * textstring = f.read() + * import unicodedata + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":364 + * raise ioe + * try: + * textstring = f.read() # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_textstring = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":365 + * try: + * textstring = f.read() + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + * return norm_text + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_unicodedata = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":366 + * textstring = f.read() + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns # <<<<<<<<<<<<<< + * return norm_text + * except Exception as e: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_textstring); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_textstring); + __Pyx_GIVEREF(__pyx_v_textstring); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_norm_text = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":367 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + * return norm_text # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_norm_text); + __pyx_r = __pyx_v_norm_text; + goto __pyx_L21_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":368 + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + * return norm_text + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/file.pyx":369 + * return norm_text + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":370 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L27; + } + __pyx_L27:; + + /* "lib/Naked/toolshed/c/file.pyx":371 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * finally: + * f.close() + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + goto __pyx_L15_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_L24_try_end:; + } + } + + /* "lib/Naked/toolshed/c/file.pyx":373 + * raise e + * finally: + * f.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + /*exception exit:*/{ + __pyx_L15_error:; + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + __pyx_L29_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + goto __pyx_L1_error; + } + __pyx_L14_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + + /* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_ioe); + __Pyx_XDECREF(__pyx_v_textstring); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("file"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader, __pyx_k_FileReader, sizeof(__pyx_k_FileReader), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader___init, __pyx_k_FileReader___init, sizeof(__pyx_k_FileReader___init), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read, __pyx_k_FileReader_read, sizeof(__pyx_k_FileReader_read), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_as, __pyx_k_FileReader_read_as, sizeof(__pyx_k_FileReader_read_as), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_bin, __pyx_k_FileReader_read_bin, sizeof(__pyx_k_FileReader_read_bin), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_gzip, __pyx_k_FileReader_read_gzip, sizeof(__pyx_k_FileReader_read_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_utf8, __pyx_k_FileReader_read_utf8, sizeof(__pyx_k_FileReader_read_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_readlines, __pyx_k_FileReader_readlines, sizeof(__pyx_k_FileReader_readlines), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_readlines_as, __pyx_k_FileReader_readlines_as, sizeof(__pyx_k_FileReader_readlines_as), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_readlines_utf8, __pyx_k_FileReader_readlines_utf8, sizeof(__pyx_k_FileReader_readlines_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter, __pyx_k_FileWriter, sizeof(__pyx_k_FileWriter), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter___init, __pyx_k_FileWriter___init, sizeof(__pyx_k_FileWriter___init), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_append, __pyx_k_FileWriter_append, sizeof(__pyx_k_FileWriter_append), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_append_utf8, __pyx_k_FileWriter_append_utf8, sizeof(__pyx_k_FileWriter_append_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_gzip, __pyx_k_FileWriter_gzip, sizeof(__pyx_k_FileWriter_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_safe_write, __pyx_k_FileWriter_safe_write, sizeof(__pyx_k_FileWriter_safe_write), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_safe_write_bin, __pyx_k_FileWriter_safe_write_bin, sizeof(__pyx_k_FileWriter_safe_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write, __pyx_k_FileWriter_write, sizeof(__pyx_k_FileWriter_write), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write_as, __pyx_k_FileWriter_write_as, sizeof(__pyx_k_FileWriter_write_as), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write_bin, __pyx_k_FileWriter_write_bin, sizeof(__pyx_k_FileWriter_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write_utf8, __pyx_k_FileWriter_write_utf8, sizeof(__pyx_k_FileWriter_write_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_IO, __pyx_k_IO, sizeof(__pyx_k_IO), 0, 0, 1, 1}, + {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_IO___init, __pyx_k_IO___init, sizeof(__pyx_k_IO___init), 0, 0, 1, 1}, + {&__pyx_n_s_NFKD, __pyx_k_NFKD, sizeof(__pyx_k_NFKD), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_k_Naked_Framework_Error_Unable_to, sizeof(__pyx_k_Naked_Framework_Error_Unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_10, __pyx_k_Naked_Framework_Error_Unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_10), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_11, __pyx_k_Naked_Framework_Error_Unable_to_11, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_11), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_12, __pyx_k_Naked_Framework_Error_Unable_to_12, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_12), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_13, __pyx_k_Naked_Framework_Error_Unable_to_13, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_13), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_14, __pyx_k_Naked_Framework_Error_Unable_to_14, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_14), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_15, __pyx_k_Naked_Framework_Error_Unable_to_15, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_15), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_k_Naked_Framework_Error_Unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_3, __pyx_k_Naked_Framework_Error_Unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_4, __pyx_k_Naked_Framework_Error_Unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_5, __pyx_k_Naked_Framework_Error_Unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_k_Naked_Framework_Error_Unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_7, __pyx_k_Naked_Framework_Error_Unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_8, __pyx_k_Naked_Framework_Error_Unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_9, __pyx_k_Naked_Framework_Error_Unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_9), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_system, __pyx_k_Naked_toolshed_system, sizeof(__pyx_k_Naked_toolshed_system), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_kp_s_The_file_specified_for_the_text, __pyx_k_The_file_specified_for_the_text, sizeof(__pyx_k_The_file_specified_for_the_text), 0, 0, 1, 0}, + {&__pyx_kp_s_The_file_specified_for_the_text_2, __pyx_k_The_file_specified_for_the_text_2, sizeof(__pyx_k_The_file_specified_for_the_text_2), 0, 0, 1, 0}, + {&__pyx_kp_s_The_text_encoding_was_not_specif, __pyx_k_The_text_encoding_was_not_specif, sizeof(__pyx_k_The_text_encoding_was_not_specif), 0, 0, 1, 0}, + {&__pyx_kp_s_The_text_file_encoding_was_not_s, __pyx_k_The_text_file_encoding_was_not_s, sizeof(__pyx_k_The_text_file_encoding_was_not_s), 0, 0, 1, 0}, + {&__pyx_kp_s_The_text_file_encoding_was_not_s_2, __pyx_k_The_text_file_encoding_was_not_s_2, sizeof(__pyx_k_The_text_file_encoding_was_not_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_UTF8, __pyx_k_UTF8, sizeof(__pyx_k_UTF8), 0, 0, 1, 1}, + {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0}, + {&__pyx_n_s_UTF_8_2, __pyx_k_UTF_8_2, sizeof(__pyx_k_UTF_8_2), 0, 0, 1, 1}, + {&__pyx_n_s_UnicodeEncodeError, __pyx_k_UnicodeEncodeError, sizeof(__pyx_k_UnicodeEncodeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_append_utf8, __pyx_k_append_utf8, sizeof(__pyx_k_append_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_appender, __pyx_k_appender, sizeof(__pyx_k_appender), 0, 0, 1, 1}, + {&__pyx_n_s_bin_reader, __pyx_k_bin_reader, sizeof(__pyx_k_bin_reader), 0, 0, 1, 1}, + {&__pyx_n_s_bin_writer, __pyx_k_bin_writer, sizeof(__pyx_k_bin_writer), 0, 0, 1, 1}, + {&__pyx_n_s_binary_data, __pyx_k_binary_data, sizeof(__pyx_k_binary_data), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1}, + {&__pyx_n_s_compresslevel, __pyx_k_compresslevel, sizeof(__pyx_k_compresslevel), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_data_list, __pyx_k_data_list, sizeof(__pyx_k_data_list), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_dev_spec_encoding, __pyx_k_dev_spec_encoding, sizeof(__pyx_k_dev_spec_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_file_data, __pyx_k_file_data, sizeof(__pyx_k_file_data), 0, 0, 1, 1}, + {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1}, + {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, + {&__pyx_kp_s_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 0, 1, 0}, + {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_gzip_reader, __pyx_k_gzip_reader, sizeof(__pyx_k_gzip_reader), 0, 0, 1, 1}, + {&__pyx_n_s_gzip_writer, __pyx_k_gzip_writer, sizeof(__pyx_k_gzip_writer), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_ioe, __pyx_k_ioe, sizeof(__pyx_k_ioe), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_file, __pyx_k_lib_Naked_toolshed_c_file, sizeof(__pyx_k_lib_Naked_toolshed_c_file), 0, 0, 1, 1}, + {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_modified_text_list, __pyx_k_modified_text_list, sizeof(__pyx_k_modified_text_list), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_norm_data, __pyx_k_norm_data, sizeof(__pyx_k_norm_data), 0, 0, 1, 1}, + {&__pyx_n_s_norm_line, __pyx_k_norm_line, sizeof(__pyx_k_norm_line), 0, 0, 1, 1}, + {&__pyx_n_s_norm_text, __pyx_k_norm_text, sizeof(__pyx_k_norm_text), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_read_as, __pyx_k_read_as, sizeof(__pyx_k_read_as), 0, 0, 1, 1}, + {&__pyx_n_s_read_bin, __pyx_k_read_bin, sizeof(__pyx_k_read_bin), 0, 0, 1, 1}, + {&__pyx_n_s_read_gzip, __pyx_k_read_gzip, sizeof(__pyx_k_read_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_read_utf8, __pyx_k_read_utf8, sizeof(__pyx_k_read_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1}, + {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1}, + {&__pyx_n_s_readlines_as, __pyx_k_readlines_as, sizeof(__pyx_k_readlines_as), 0, 0, 1, 1}, + {&__pyx_n_s_readlines_utf8, __pyx_k_readlines_utf8, sizeof(__pyx_k_readlines_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_safe_write, __pyx_k_safe_write, sizeof(__pyx_k_safe_write), 0, 0, 1, 1}, + {&__pyx_n_s_safe_write_bin, __pyx_k_safe_write_bin, sizeof(__pyx_k_safe_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_system_default, __pyx_k_system_default, sizeof(__pyx_k_system_default), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, + {&__pyx_n_s_textstring, __pyx_k_textstring, sizeof(__pyx_k_textstring), 0, 0, 1, 1}, + {&__pyx_n_s_the_encoding, __pyx_k_the_encoding, sizeof(__pyx_k_the_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_ue, __pyx_k_ue, sizeof(__pyx_k_ue), 0, 0, 1, 1}, + {&__pyx_n_s_uni_reader, __pyx_k_uni_reader, sizeof(__pyx_k_uni_reader), 0, 0, 1, 1}, + {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1}, + {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8_2, __pyx_k_utf_8_2, sizeof(__pyx_k_utf_8_2), 0, 0, 1, 0}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_write_as, __pyx_k_write_as, sizeof(__pyx_k_write_as), 0, 0, 1, 1}, + {&__pyx_n_s_write_bin, __pyx_k_write_bin, sizeof(__pyx_k_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_write_utf8, __pyx_k_write_utf8, sizeof(__pyx_k_write_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1}, + {&__pyx_n_s_wt, __pyx_k_wt, sizeof(__pyx_k_wt), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/file.pyx":33 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") # <<<<<<<<<<<<<< + * with open(self.filepath, 'a') as appender: + * appender.write(text) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_The_file_specified_for_the_text); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/file.pyx":34 + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: # <<<<<<<<<<<<<< + * appender.write(text) + * except UnicodeEncodeError as ue: + */ + __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/file.pyx":40 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/file.pyx":52 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") # <<<<<<<<<<<<<< + * import codecs + * import unicodedata + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_The_file_specified_for_the_text_2); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "lib/Naked/toolshed/c/file.pyx":56 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: # <<<<<<<<<<<<<< + * appender.write(norm_text) + * except Exception as e: + */ + __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/file.pyx":60 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "lib/Naked/toolshed/c/file.pyx":74 + * try: + * import gzip + * if not self.filepath.endswith(".gz"): # <<<<<<<<<<<<<< + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_gz); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/file.pyx":76 + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + */ + __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "lib/Naked/toolshed/c/file.pyx":83 + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(binary_data) + * except Exception as e: + */ + __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/file.pyx":87 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/file.pyx":98 + * def write(self, text): + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * except UnicodeEncodeError as ue: + */ + __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/file.pyx":104 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_3); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/file.pyx":115 + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_The_text_encoding_was_not_specif); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/file.pyx":117 + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: # <<<<<<<<<<<<<< + * f.write(text) + * except Exception as e: + */ + __pyx_tuple__15 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/file.pyx":121 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/file.pyx":131 + * def write_bin(self, binary_data): + * try: + * with open(self.filepath, 'wb') as bin_writer: # <<<<<<<<<<<<<< + * bin_writer.write(binary_data) + * except Exception as e: + */ + __pyx_tuple__17 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "lib/Naked/toolshed/c/file.pyx":135 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_4); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/file.pyx":148 + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * return True + */ + __pyx_tuple__19 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "lib/Naked/toolshed/c/file.pyx":156 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * else: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_5); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "lib/Naked/toolshed/c/file.pyx":170 + * import os.path + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: # <<<<<<<<<<<<<< + * writer.write(file_data) + * return True + */ + __pyx_tuple__21 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "lib/Naked/toolshed/c/file.pyx":177 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_6); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "lib/Naked/toolshed/c/file.pyx":194 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_7); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/file.pyx":202 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_8); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "lib/Naked/toolshed/c/file.pyx":227 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_9); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "lib/Naked/toolshed/c/file.pyx":238 + * def read_bin(self): + * try: + * with open(self.filepath, 'rb') as bin_reader: # <<<<<<<<<<<<<< + * data = bin_reader.read() + * return data + */ + __pyx_tuple__26 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "lib/Naked/toolshed/c/file.pyx":243 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_10); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "lib/Naked/toolshed/c/file.pyx":255 + * try: + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_The_text_file_encoding_was_not_s); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "lib/Naked/toolshed/c/file.pyx":257 + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: # <<<<<<<<<<<<<< + * data = f.read() + * return data + */ + __pyx_tuple__30 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "lib/Naked/toolshed/c/file.pyx":262 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_11); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "lib/Naked/toolshed/c/file.pyx":276 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_12); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "lib/Naked/toolshed/c/file.pyx":288 + * try: + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_The_text_file_encoding_was_not_s_2); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "lib/Naked/toolshed/c/file.pyx":290 + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: # <<<<<<<<<<<<<< + * data_list = [] + * for line in reader: + */ + __pyx_tuple__34 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__35 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "lib/Naked/toolshed/c/file.pyx":297 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "lib/Naked/toolshed/c/file.pyx":309 + * try: + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: # <<<<<<<<<<<<<< + * modified_text_list = [] + * for line in uni_reader: + */ + __pyx_tuple__37 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__38 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "lib/Naked/toolshed/c/file.pyx":318 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "lib/Naked/toolshed/c/file.pyx":332 + * try: + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: # <<<<<<<<<<<<<< + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + */ + __pyx_tuple__40 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__41 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "lib/Naked/toolshed/c/file.pyx":344 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_13); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "lib/Naked/toolshed/c/file.pyx":361 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_14); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "lib/Naked/toolshed/c/file.pyx":370 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_15); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filepath); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filepath); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_tuple__49 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_file_exists, __pyx_n_s_appender, __pyx_n_s_ue, __pyx_n_s_e); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_append, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_tuple__51 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_file_exists, __pyx_n_s_codecs, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_appender, __pyx_n_s_e); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_append_utf8, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_tuple__53 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_compression_level, __pyx_n_s_gzip, __pyx_n_s_gzip_writer, __pyx_n_s_ue, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_codecs, __pyx_n_s_binary_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_gzip, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__55 = PyTuple_Pack(1, ((PyObject *)__pyx_int_6)); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_writer, __pyx_n_s_ue, __pyx_n_s_e); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + __pyx_tuple__58 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_the_encoding, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_e); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write_as, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__60 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__13)); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_binary_data, __pyx_n_s_bin_writer, __pyx_n_s_e); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write_bin, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + __pyx_tuple__63 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_os, __pyx_n_s_writer, __pyx_n_s_ue, __pyx_n_s_e); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_safe_write, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_file_data, __pyx_n_s_os, __pyx_n_s_writer, __pyx_n_s_e); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_safe_write_bin, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_tuple__67 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_ioe, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write_utf8, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filepath); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_bin_reader, __pyx_n_s_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_bin, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_the_encoding, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_as, 252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_readlines, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_dev_spec_encoding, __pyx_n_s_codecs, __pyx_n_s_reader, __pyx_n_s_data_list, __pyx_n_s_line, __pyx_n_s_e); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_readlines_as, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_codecs, __pyx_n_s_uni_reader, __pyx_n_s_modified_text_list, __pyx_n_s_line, __pyx_n_s_unicodedata, __pyx_n_s_norm_line, __pyx_n_s_e); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_readlines_utf8, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_tuple__83 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_encoding, __pyx_n_s_gzip, __pyx_n_s_gzip_reader, __pyx_n_s_file_data, __pyx_n_s_codecs, __pyx_n_s_unicodedata, __pyx_n_s_norm_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_gzip, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__85 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_system_default)); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_ioe, __pyx_n_s_textstring, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_utf8, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initfile(void); /*proto*/ +PyMODINIT_FUNC initfile(void) +#else +PyMODINIT_FUNC PyInit_file(void); /*proto*/ +PyMODINIT_FUNC PyInit_file(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_file(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("file"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__file) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.file")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.file", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/file.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":6 + * + * import sys + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":12 + * # interface for all local file IO classes + * #------------------------------------------------------------------------------ + * class IO: # <<<<<<<<<<<<<< + * def __init__(self,filepath): + * self.filepath = filepath + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_IO, __pyx_n_s_IO, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_file, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__, 0, __pyx_n_s_IO___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":12 + * # interface for all local file IO classes + * #------------------------------------------------------------------------------ + * class IO: # <<<<<<<<<<<<<< + * def __init__(self,filepath): + * self.filepath = filepath + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_IO, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":20 + * # writes data to local files + * #------------------------------------------------------------------------------ + * class FileWriter(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FileWriter, __pyx_n_s_FileWriter, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_file, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__, 0, __pyx_n_s_FileWriter___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append, 0, __pyx_n_s_FileWriter_append, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_append, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8, 0, __pyx_n_s_FileWriter_append_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_append_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip, 0, __pyx_n_s_FileWriter_gzip, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__55); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_gzip, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write, 0, __pyx_n_s_FileWriter_write, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as, 0, __pyx_n_s_FileWriter_write_as, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__60); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_as, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin, 0, __pyx_n_s_FileWriter_write_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_bin, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write, 0, __pyx_n_s_FileWriter_safe_write, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_safe_write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin, 0, __pyx_n_s_FileWriter_safe_write_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_safe_write_bin, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8, 0, __pyx_n_s_FileWriter_write_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":20 + * # writes data to local files + * #------------------------------------------------------------------------------ + * class FileWriter(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FileWriter, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileWriter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":212 + * # filename assigned in constructor (inherited from IO class interface) + * #------------------------------------------------------------------------------ + * class FileReader(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FileReader, __pyx_n_s_FileReader, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_file, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__, 0, __pyx_n_s_FileReader___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read, 0, __pyx_n_s_FileReader_read, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin, 0, __pyx_n_s_FileReader_read_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_bin, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as, 0, __pyx_n_s_FileReader_read_as, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_as, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines, 0, __pyx_n_s_FileReader_readlines, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_readlines, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as, 0, __pyx_n_s_FileReader_readlines_as, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_readlines_as, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8, 0, __pyx_n_s_FileReader_readlines_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_readlines_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip, 0, __pyx_n_s_FileReader_read_gzip, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__85); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_gzip, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8, 0, __pyx_n_s_FileReader_read_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":212 + * # filename assigned in constructor (inherited from IO class interface) + * #------------------------------------------------------------------------------ + * class FileReader(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FileReader, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileReader, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":376 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/file.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.file", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.file"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.pyx new file mode 100644 index 00000000..545948f7 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/file.pyx @@ -0,0 +1,377 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ IO class ] +# interface for all local file IO classes +#------------------------------------------------------------------------------ +class IO: + def __init__(self,filepath): + self.filepath = filepath + +#------------------------------------------------------------------------------ +# [ FileWriter class ] +# writes data to local files +#------------------------------------------------------------------------------ +class FileWriter(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ append method ] + # Universal text file writer that appends to existing file using system default text encoding or utf-8 if throws unicode error + # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + #------------------------------------------------------------------------------ + def append(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + with open(self.filepath, 'a') as appender: + appender.write(text) + except UnicodeEncodeError as ue: + self.append_utf8(text) #try writing as utf-8 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ append_utf8 method ] + # Text writer that appends text to existing file with utf-8 encoding + # Tests: test_IO.py :: test_file_utf8_readwrite_append + #------------------------------------------------------------------------------ + def append_utf8(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + import codecs + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + appender.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ gzip method (writer) ] + # writes data to gzip compressed file + # Note: adds .gz extension to filename if user did not specify it in the FileWriter class constructor + # Note: uses compresslevel = 6 as default to balance speed and compression level (which in general is not significantly less than 9) + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_gzip_utf8_readwrite_explicit_decode + #------------------------------------------------------------------------------ + def gzip(self, text, compression_level=6): + try: + import gzip + if not self.filepath.endswith(".gz"): + self.filepath = self.filepath + ".gz" + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(text) + except UnicodeEncodeError as ue: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + import codecs + binary_data = codecs.encode(norm_text, "utf_8") + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write method ] + # Universal text file writer that writes by system default or utf-8 encoded unicode if throws UnicdeEncodeError + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_ascii_readwrite_missing_file, + # test_file_utf8_write_raises_unicodeerror + #------------------------------------------------------------------------------ + def write(self, text): + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + except UnicodeEncodeError as ue: + self.write_utf8(text) # attempt to write with utf-8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_as method ] + # text file writer that uses developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas + #------------------------------------------------------------------------------ + def write_as(self, text, the_encoding=""): + try: + if the_encoding == "": #if the developer did not include the encoding type, raise an exception + raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + f.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_bin method ] + # binary data file writer + # Tests: test_IO.py :: test_file_bin_readwrite + #------------------------------------------------------------------------------ + def write_bin(self, binary_data): + try: + with open(self.filepath, 'wb') as bin_writer: + bin_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ safe_write method ] (boolean) + # Universal text file writer (writes in default encoding unless throws unicode error) that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + #------------------------------------------------------------------------------ + def safe_write(self, text): + import os.path + if not os.path.exists(self.filepath): # if the file does not exist, then can write + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + return True + except UnicodeEncodeError as ue: + self.write_utf8(text) + return True + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + raise e + else: + return False # if file exists, do not write and return False + + #------------------------------------------------------------------------------ + # [ safe_write_bin method ] + # Binary data file writer that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + #------------------------------------------------------------------------------ + def safe_write_bin(self, file_data): + try: + import os.path + if not os.path.exists(self.filepath): + with open(self.filepath, 'wb') as writer: + writer.write(file_data) + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ write_utf8 method ] + # Text file writer with explicit UTF-8 text encoding + # uses filepath from class constructor + # requires text to passed as a method parameter + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + #------------------------------------------------------------------------------ + def write_utf8(self, text): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='w') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + f.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + +#------------------------------------------------------------------------------ +# [ FileReader class ] +# reads data from local files +# filename assigned in constructor (inherited from IO class interface) +#------------------------------------------------------------------------------ +class FileReader(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ read method ] (string) + # Universal text file reader that will read utf-8 encoded unicode or non-unicode text as utf-8 + # returns string or unicode (py3 = string for unicode and non-unicode, py2 = str for non-unicode, unicode for unicode) + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + #------------------------------------------------------------------------------ + def read(self): + try: + return self.read_utf8() #reads everything as unicode in utf8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_bin method ] (binary byte string) + # Universal binary data file reader + # returns file contents in binary mode as binary byte strings + # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + #------------------------------------------------------------------------------ + def read_bin(self): + try: + with open(self.filepath, 'rb') as bin_reader: + data = bin_reader.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_as method ] (string with developer specified text encoding) + # Text file reader with developer specified text encoding + # returns file contents in developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + #------------------------------------------------------------------------------ + def read_as(self, the_encoding): + try: + if the_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + data = f.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines method ] (list of strings) + # Read text from file line by line, uses utf8 encoding by default + # returns list of utf8 encoded file lines as strings + # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + #------------------------------------------------------------------------------ + def readlines(self): + try: + return self.readlines_utf8() # read as utf8 encoded file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_as method ] (list of developer specified encoded strings) + # Read lines from file with developer specified text encoding + # Returns a list of developer specified encoded lines from the file + # Tests: test_IO.py :: + #------------------------------------------------------------------------------ + def readlines_as(self, dev_spec_encoding): + try: + if dev_spec_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + import codecs + with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + data_list = [] + for line in reader: + data_list.append(line) + return data_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_utf8 method ] (list of utf-8 encoded strings) + # Read text from unicode file by line + # Returns list of file unicode text lines as unicode strings + # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + #------------------------------------------------------------------------------ + def readlines_utf8(self): + try: + import codecs + with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + modified_text_list = [] + for line in uni_reader: + import unicodedata + norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + modified_text_list.append(norm_line) + return modified_text_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + raise e + + #------------------------------------------------------------------------------ + # [ read_gzip ] (byte string) + # reads data from a gzip compressed file + # returns the decompressed binary data from the file + # Note: if decompressing unicode file, set encoding="utf-8" + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_read_gzip_missing_file + #------------------------------------------------------------------------------ + def read_gzip(self, encoding="system_default"): + try: + import gzip + with gzip.open(self.filepath, 'rb') as gzip_reader: + file_data = gzip_reader.read() + if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + import codecs + file_data = codecs.decode(file_data, "utf-8") + import unicodedata + norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + return norm_data + else: + return file_data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_utf8 method ] (string) + # read data from a file with explicit UTF-8 encoding + # uses filepath from class constructor + # returns a unicode string containing the file data (unicode in py2, str in py3) + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_append, + # test_file_read_utf8_missing_file + #------------------------------------------------------------------------------ + def read_utf8(self): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='r') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + textstring = f.read() + import unicodedata + norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + return norm_text + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.c new file mode 100644 index 00000000..e34bfc1e --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.c @@ -0,0 +1,4232 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:14 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__ink +#define __PYX_HAVE_API__lib__Naked__toolshed__c__ink +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "ink.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define Pyx_PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.ink' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.ink" +int __pyx_module_is_main_lib__Naked__toolshed__c__ink = 0; + +/* Implementation of 'lib.Naked.toolshed.c.ink' */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_template_text, PyObject *__pyx_v_open_delimiter, PyObject *__pyx_v_close_delimiter, PyObject *__pyx_v_escape_regex); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_2_make_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template_text, PyObject *__pyx_v_escape_regex); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_4_escape_regex_special_chars(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_test_escape_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template, PyObject *__pyx_v_key, PyObject *__pyx_v_html_entities); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer_2render(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_[] = "{{"; +static char __pyx_k__2[] = "}}"; +static char __pyx_k__3[] = "(.*?)"; +static char __pyx_k_re[] = "re"; +static char __pyx_k_cls[] = "cls"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_new[] = "__new__"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_cdel[] = "cdel"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_odel[] = "odel"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_escape[] = "escape"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_render[] = "render"; +static char __pyx_k_findall[] = "findall"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_replace[] = "replace"; +static char __pyx_k_varlist[] = "varlist"; +static char __pyx_k_Renderer[] = "Renderer"; +static char __pyx_k_Template[] = "Template"; +static char __pyx_k_key_dict[] = "key_dict"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_template[] = "template"; +static char __pyx_k_var_list[] = "var_list"; +static char __pyx_k_match_pat[] = "match_pat"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_local_cdel[] = "local_cdel"; +static char __pyx_k_local_dict[] = "local_dict"; +static char __pyx_k_local_odel[] = "local_odel"; +static char __pyx_k_escape_regex[] = "escape_regex"; +static char __pyx_k_html_entities[] = "html_entities"; +static char __pyx_k_local_htmlent[] = "local_htmlent"; +static char __pyx_k_local_varlist[] = "local_varlist"; +static char __pyx_k_make_var_list[] = "_make_var_list"; +static char __pyx_k_template_text[] = "template_text"; +static char __pyx_k_Template___new[] = "Template.__new__"; +static char __pyx_k_local_template[] = "local_template"; +static char __pyx_k_open_delimiter[] = "open_delimiter"; +static char __pyx_k_open_match_pat[] = "open_match_pat"; +static char __pyx_k_replace_string[] = "replace_string"; +static char __pyx_k_Renderer___init[] = "Renderer.__init__"; +static char __pyx_k_Renderer_render[] = "Renderer.render"; +static char __pyx_k_close_delimiter[] = "close_delimiter"; +static char __pyx_k_close_match_pat[] = "close_match_pat"; +static char __pyx_k_xml_sax_saxutils[] = "xml.sax.saxutils"; +static char __pyx_k_test_escape_string[] = "test_escape_string"; +static char __pyx_k_Template__make_var_list[] = "Template._make_var_list"; +static char __pyx_k_lib_Naked_toolshed_c_ink[] = "lib.Naked.toolshed.c.ink"; +static char __pyx_k_escape_regex_special_chars[] = "_escape_regex_special_chars"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/ink.pyx"; +static char __pyx_k_Template__escape_regex_special_c[] = "Template._escape_regex_special_chars"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_Renderer; +static PyObject *__pyx_n_s_Renderer___init; +static PyObject *__pyx_n_s_Renderer_render; +static PyObject *__pyx_n_s_Template; +static PyObject *__pyx_n_s_Template___new; +static PyObject *__pyx_n_s_Template__escape_regex_special_c; +static PyObject *__pyx_n_s_Template__make_var_list; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s_cdel; +static PyObject *__pyx_n_s_close_delimiter; +static PyObject *__pyx_n_s_close_match_pat; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_escape; +static PyObject *__pyx_n_s_escape_regex; +static PyObject *__pyx_n_s_escape_regex_special_chars; +static PyObject *__pyx_n_s_findall; +static PyObject *__pyx_n_s_html_entities; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_key_dict; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_ink; +static PyObject *__pyx_n_s_local_cdel; +static PyObject *__pyx_n_s_local_dict; +static PyObject *__pyx_n_s_local_htmlent; +static PyObject *__pyx_n_s_local_odel; +static PyObject *__pyx_n_s_local_template; +static PyObject *__pyx_n_s_local_varlist; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_var_list; +static PyObject *__pyx_n_s_match_pat; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_odel; +static PyObject *__pyx_n_s_open_delimiter; +static PyObject *__pyx_n_s_open_match_pat; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_re; +static PyObject *__pyx_n_s_render; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_replace_string; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_template; +static PyObject *__pyx_n_s_template_text; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_escape_string; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_var_list; +static PyObject *__pyx_n_s_varlist; +static PyObject *__pyx_n_s_xml_sax_saxutils; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__16; + +/* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_template_text = 0; + PyObject *__pyx_v_open_delimiter = 0; + PyObject *__pyx_v_close_delimiter = 0; + PyObject *__pyx_v_escape_regex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_template_text,&__pyx_n_s_open_delimiter,&__pyx_n_s_close_delimiter,&__pyx_n_s_escape_regex,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[3] = ((PyObject *)((PyObject*)__pyx_kp_s__2)); + values[4] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open_delimiter); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close_delimiter); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_escape_regex); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_template_text = values[1]; + __pyx_v_open_delimiter = values[2]; + __pyx_v_close_delimiter = values[3]; + __pyx_v_escape_regex = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template___new__(__pyx_self, __pyx_v_cls, __pyx_v_template_text, __pyx_v_open_delimiter, __pyx_v_close_delimiter, __pyx_v_escape_regex); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_template_text, PyObject *__pyx_v_open_delimiter, PyObject *__pyx_v_close_delimiter, PyObject *__pyx_v_escape_regex) { + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":27 + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) # <<<<<<<<<<<<<< + * obj.odel = open_delimiter + * obj.cdel = close_delimiter + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_template_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_template_text); + __Pyx_GIVEREF(__pyx_v_template_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":28 + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter # <<<<<<<<<<<<<< + * obj.cdel = close_delimiter + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_odel, __pyx_v_open_delimiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":29 + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + * obj.cdel = close_delimiter # <<<<<<<<<<<<<< + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + * return obj + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_cdel, __pyx_v_close_delimiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":30 + * obj.odel = open_delimiter + * obj.cdel = close_delimiter + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list # <<<<<<<<<<<<<< + * return obj + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_make_var_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_template_text); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_template_text); + __Pyx_GIVEREF(__pyx_v_template_text); + __Pyx_INCREF(__pyx_v_escape_regex); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_escape_regex); + __Pyx_GIVEREF(__pyx_v_escape_regex); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_varlist, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":31 + * obj.cdel = close_delimiter + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + * return obj # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list = {__Pyx_NAMESTR("_make_var_list"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_template_text = 0; + PyObject *__pyx_v_escape_regex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_make_var_list (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_template_text,&__pyx_n_s_escape_regex,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_make_var_list", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_escape_regex); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_make_var_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_template_text = values[1]; + __pyx_v_escape_regex = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_make_var_list", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._make_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_2_make_var_list(__pyx_self, __pyx_v_self, __pyx_v_template_text, __pyx_v_escape_regex); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_2_make_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template_text, PyObject *__pyx_v_escape_regex) { + PyObject *__pyx_v_open_match_pat = NULL; + PyObject *__pyx_v_close_match_pat = NULL; + PyObject *__pyx_v_match_pat = NULL; + PyObject *__pyx_v_var_list = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_var_list", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":39 + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): + * if escape_regex: # <<<<<<<<<<<<<< + * open_match_pat = self._escape_regex_special_chars(self.odel) + * close_match_pat = self._escape_regex_special_chars(self.cdel) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_escape_regex); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "lib/Naked/toolshed/c/ink.pyx":40 + * def _make_var_list(self, template_text, escape_regex=False): + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) # <<<<<<<<<<<<<< + * close_match_pat = self._escape_regex_special_chars(self.cdel) + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_escape_regex_special_chars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_odel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_open_match_pat = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":41 + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + * close_match_pat = self._escape_regex_special_chars(self.cdel) # <<<<<<<<<<<<<< + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_escape_regex_special_chars); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_close_match_pat = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":42 + * open_match_pat = self._escape_regex_special_chars(self.odel) + * close_match_pat = self._escape_regex_special_chars(self.cdel) + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters # <<<<<<<<<<<<<< + * else: + * match_pat = self.odel + r'(.*?)' + self.cdel + */ + __pyx_t_4 = PyNumber_Add(__pyx_v_open_match_pat, __pyx_kp_s__3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_close_match_pat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_match_pat = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/ink.pyx":44 + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + * else: + * match_pat = self.odel + r'(.*?)' + self.cdel # <<<<<<<<<<<<<< + * var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + * return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_odel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_match_pat = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/ink.pyx":45 + * else: + * match_pat = self.odel + r'(.*?)' + self.cdel + * var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) # <<<<<<<<<<<<<< + * return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_findall); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_match_pat); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match_pat); + __Pyx_GIVEREF(__pyx_v_match_pat); + __Pyx_INCREF(__pyx_v_template_text); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_template_text); + __Pyx_GIVEREF(__pyx_v_template_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_var_list = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":46 + * match_pat = self.odel + r'(.*?)' + self.cdel + * var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + * return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_var_list); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_var_list); + __Pyx_GIVEREF(__pyx_v_var_list); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._make_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_open_match_pat); + __Pyx_XDECREF(__pyx_v_close_match_pat); + __Pyx_XDECREF(__pyx_v_match_pat); + __Pyx_XDECREF(__pyx_v_var_list); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars = {__Pyx_NAMESTR("_escape_regex_special_chars"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_test_escape_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_escape_regex_special_chars (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_test_escape_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test_escape_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_escape_regex_special_chars", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_escape_regex_special_chars") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_test_escape_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_escape_regex_special_chars", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._escape_regex_special_chars", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_4_escape_regex_special_chars(__pyx_self, __pyx_v_self, __pyx_v_test_escape_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_4_escape_regex_special_chars(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_test_escape_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_escape_regex_special_chars", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":54 + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): + * return re.escape(test_escape_string) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_escape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_test_escape_string); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_test_escape_string); + __Pyx_GIVEREF(__pyx_v_test_escape_string); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._escape_regex_special_chars", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_template = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_html_entities = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_template,&__pyx_n_s_key,&__pyx_n_s_html_entities,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_html_entities); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_template = values[1]; + __pyx_v_key = values[2]; + __pyx_v_html_entities = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer___init__(__pyx_self, __pyx_v_self, __pyx_v_template, __pyx_v_key, __pyx_v_html_entities); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template, PyObject *__pyx_v_key, PyObject *__pyx_v_html_entities) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":69 + * class Renderer: + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel # <<<<<<<<<<<<<< + * self.cdel = template.cdel + * self.template = template + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_template, __pyx_n_s_odel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_odel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":70 + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel + * self.cdel = template.cdel # <<<<<<<<<<<<<< + * self.template = template + * self.html_entities = html_entities + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_template, __pyx_n_s_cdel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cdel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":71 + * self.odel = template.odel + * self.cdel = template.cdel + * self.template = template # <<<<<<<<<<<<<< + * self.html_entities = html_entities + * self.key_dict = key + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_template, __pyx_v_template) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":72 + * self.cdel = template.cdel + * self.template = template + * self.html_entities = html_entities # <<<<<<<<<<<<<< + * self.key_dict = key + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_html_entities, __pyx_v_html_entities) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":73 + * self.template = template + * self.html_entities = html_entities + * self.key_dict = key # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_key_dict, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render = {__Pyx_NAMESTR("render"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("render (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer_2render(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer_2render(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_local_dict = NULL; + PyObject *__pyx_v_local_template = NULL; + PyObject *__pyx_v_local_varlist = NULL; + PyObject *__pyx_v_local_odel = NULL; + PyObject *__pyx_v_local_cdel = NULL; + PyObject *__pyx_v_local_htmlent = NULL; + PyObject *__pyx_v_escape = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_replace_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("render", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":82 + * def render(self): + * # make local variables for the loop below (faster) + * local_dict = self.key_dict # <<<<<<<<<<<<<< + * local_template = self.template + * local_varlist = self.template.varlist + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_local_dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":83 + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + * local_template = self.template # <<<<<<<<<<<<<< + * local_varlist = self.template.varlist + * local_odel = self.odel + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_template); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_local_template = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":84 + * local_dict = self.key_dict + * local_template = self.template + * local_varlist = self.template.varlist # <<<<<<<<<<<<<< + * local_odel = self.odel + * local_cdel = self.cdel + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_template); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_varlist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_local_varlist = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":85 + * local_template = self.template + * local_varlist = self.template.varlist + * local_odel = self.odel # <<<<<<<<<<<<<< + * local_cdel = self.cdel + * local_htmlent = self.html_entities + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_odel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_local_odel = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":86 + * local_varlist = self.template.varlist + * local_odel = self.odel + * local_cdel = self.cdel # <<<<<<<<<<<<<< + * local_htmlent = self.html_entities + * if local_htmlent: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_local_cdel = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":87 + * local_odel = self.odel + * local_cdel = self.cdel + * local_htmlent = self.html_entities # <<<<<<<<<<<<<< + * if local_htmlent: + * from xml.sax.saxutils import escape #from Python std lib + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_html_entities); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_local_htmlent = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":88 + * local_cdel = self.cdel + * local_htmlent = self.html_entities + * if local_htmlent: # <<<<<<<<<<<<<< + * from xml.sax.saxutils import escape #from Python std lib + * for key in local_dict: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_local_htmlent); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/ink.pyx":89 + * local_htmlent = self.html_entities + * if local_htmlent: + * from xml.sax.saxutils import escape #from Python std lib # <<<<<<<<<<<<<< + * for key in local_dict: + * if key in local_varlist: + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_escape); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_escape); + __Pyx_GIVEREF(__pyx_n_s_escape); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_xml_sax_saxutils, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_escape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_escape = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/ink.pyx":90 + * if local_htmlent: + * from xml.sax.saxutils import escape #from Python std lib + * for key in local_dict: # <<<<<<<<<<<<<< + * if key in local_varlist: + * value = local_dict[key] + */ + if (PyList_CheckExact(__pyx_v_local_dict) || PyTuple_CheckExact(__pyx_v_local_dict)) { + __pyx_t_1 = __pyx_v_local_dict; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_local_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":91 + * from xml.sax.saxutils import escape #from Python std lib + * for key in local_dict: + * if key in local_varlist: # <<<<<<<<<<<<<< + * value = local_dict[key] + * replace_string = local_odel + key + local_cdel + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_local_varlist, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/ink.pyx":92 + * for key in local_dict: + * if key in local_varlist: + * value = local_dict[key] # <<<<<<<<<<<<<< + * replace_string = local_odel + key + local_cdel + * if local_htmlent: + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_local_dict, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":93 + * if key in local_varlist: + * value = local_dict[key] + * replace_string = local_odel + key + local_cdel # <<<<<<<<<<<<<< + * if local_htmlent: + * value = escape(value) #xml.sax.saxutils function + */ + __pyx_t_2 = PyNumber_Add(__pyx_v_local_odel, __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_local_cdel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_replace_string, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":94 + * value = local_dict[key] + * replace_string = local_odel + key + local_cdel + * if local_htmlent: # <<<<<<<<<<<<<< + * value = escape(value) #xml.sax.saxutils function + * local_template = local_template.replace(replace_string, value) + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_local_htmlent); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/ink.pyx":95 + * replace_string = local_odel + key + local_cdel + * if local_htmlent: + * value = escape(value) #xml.sax.saxutils function # <<<<<<<<<<<<<< + * local_template = local_template.replace(replace_string, value) + * return local_template + */ + if (unlikely(!__pyx_v_escape)) { __Pyx_RaiseUnboundLocalError("escape"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_escape, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "lib/Naked/toolshed/c/ink.pyx":96 + * if local_htmlent: + * value = escape(value) #xml.sax.saxutils function + * local_template = local_template.replace(replace_string, value) # <<<<<<<<<<<<<< + * return local_template + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_template, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_replace_string); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_replace_string); + __Pyx_GIVEREF(__pyx_v_replace_string); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_local_template, __pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L6; + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":97 + * value = escape(value) #xml.sax.saxutils function + * local_template = local_template.replace(replace_string, value) + * return local_template # <<<<<<<<<<<<<< + * + * ##TODO : multiple file render method? + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_local_template); + __pyx_r = __pyx_v_local_template; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Renderer.render", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_local_dict); + __Pyx_XDECREF(__pyx_v_local_template); + __Pyx_XDECREF(__pyx_v_local_varlist); + __Pyx_XDECREF(__pyx_v_local_odel); + __Pyx_XDECREF(__pyx_v_local_cdel); + __Pyx_XDECREF(__pyx_v_local_htmlent); + __Pyx_XDECREF(__pyx_v_escape); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_replace_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("ink"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_Renderer, __pyx_k_Renderer, sizeof(__pyx_k_Renderer), 0, 0, 1, 1}, + {&__pyx_n_s_Renderer___init, __pyx_k_Renderer___init, sizeof(__pyx_k_Renderer___init), 0, 0, 1, 1}, + {&__pyx_n_s_Renderer_render, __pyx_k_Renderer_render, sizeof(__pyx_k_Renderer_render), 0, 0, 1, 1}, + {&__pyx_n_s_Template, __pyx_k_Template, sizeof(__pyx_k_Template), 0, 0, 1, 1}, + {&__pyx_n_s_Template___new, __pyx_k_Template___new, sizeof(__pyx_k_Template___new), 0, 0, 1, 1}, + {&__pyx_n_s_Template__escape_regex_special_c, __pyx_k_Template__escape_regex_special_c, sizeof(__pyx_k_Template__escape_regex_special_c), 0, 0, 1, 1}, + {&__pyx_n_s_Template__make_var_list, __pyx_k_Template__make_var_list, sizeof(__pyx_k_Template__make_var_list), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s_cdel, __pyx_k_cdel, sizeof(__pyx_k_cdel), 0, 0, 1, 1}, + {&__pyx_n_s_close_delimiter, __pyx_k_close_delimiter, sizeof(__pyx_k_close_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_close_match_pat, __pyx_k_close_match_pat, sizeof(__pyx_k_close_match_pat), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_escape, __pyx_k_escape, sizeof(__pyx_k_escape), 0, 0, 1, 1}, + {&__pyx_n_s_escape_regex, __pyx_k_escape_regex, sizeof(__pyx_k_escape_regex), 0, 0, 1, 1}, + {&__pyx_n_s_escape_regex_special_chars, __pyx_k_escape_regex_special_chars, sizeof(__pyx_k_escape_regex_special_chars), 0, 0, 1, 1}, + {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1}, + {&__pyx_n_s_html_entities, __pyx_k_html_entities, sizeof(__pyx_k_html_entities), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_key_dict, __pyx_k_key_dict, sizeof(__pyx_k_key_dict), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_ink, __pyx_k_lib_Naked_toolshed_c_ink, sizeof(__pyx_k_lib_Naked_toolshed_c_ink), 0, 0, 1, 1}, + {&__pyx_n_s_local_cdel, __pyx_k_local_cdel, sizeof(__pyx_k_local_cdel), 0, 0, 1, 1}, + {&__pyx_n_s_local_dict, __pyx_k_local_dict, sizeof(__pyx_k_local_dict), 0, 0, 1, 1}, + {&__pyx_n_s_local_htmlent, __pyx_k_local_htmlent, sizeof(__pyx_k_local_htmlent), 0, 0, 1, 1}, + {&__pyx_n_s_local_odel, __pyx_k_local_odel, sizeof(__pyx_k_local_odel), 0, 0, 1, 1}, + {&__pyx_n_s_local_template, __pyx_k_local_template, sizeof(__pyx_k_local_template), 0, 0, 1, 1}, + {&__pyx_n_s_local_varlist, __pyx_k_local_varlist, sizeof(__pyx_k_local_varlist), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_var_list, __pyx_k_make_var_list, sizeof(__pyx_k_make_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_match_pat, __pyx_k_match_pat, sizeof(__pyx_k_match_pat), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_odel, __pyx_k_odel, sizeof(__pyx_k_odel), 0, 0, 1, 1}, + {&__pyx_n_s_open_delimiter, __pyx_k_open_delimiter, sizeof(__pyx_k_open_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_open_match_pat, __pyx_k_open_match_pat, sizeof(__pyx_k_open_match_pat), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_replace_string, __pyx_k_replace_string, sizeof(__pyx_k_replace_string), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1}, + {&__pyx_n_s_template_text, __pyx_k_template_text, sizeof(__pyx_k_template_text), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_escape_string, __pyx_k_test_escape_string, sizeof(__pyx_k_test_escape_string), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_var_list, __pyx_k_var_list, sizeof(__pyx_k_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_varlist, __pyx_k_varlist, sizeof(__pyx_k_varlist), 0, 0, 1, 1}, + {&__pyx_n_s_xml_sax_saxutils, __pyx_k_xml_sax_saxutils, sizeof(__pyx_k_xml_sax_saxutils), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_template_text, __pyx_n_s_open_delimiter, __pyx_n_s_close_delimiter, __pyx_n_s_escape_regex, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__6 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject*)__pyx_kp_s__2), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_template_text, __pyx_n_s_escape_regex, __pyx_n_s_open_match_pat, __pyx_n_s_close_match_pat, __pyx_n_s_match_pat, __pyx_n_s_var_list); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_var_list, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__9 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_test_escape_string); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_escape_regex_special_chars, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_template, __pyx_n_s_key, __pyx_n_s_html_entities); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + __pyx_tuple__15 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_local_dict, __pyx_n_s_local_template, __pyx_n_s_local_varlist, __pyx_n_s_local_odel, __pyx_n_s_local_cdel, __pyx_n_s_local_htmlent, __pyx_n_s_escape, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_replace_string); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_render, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initink(void); /*proto*/ +PyMODINIT_FUNC initink(void) +#else +PyMODINIT_FUNC PyInit_ink(void); /*proto*/ +PyMODINIT_FUNC PyInit_ink(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_ink(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ink"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__ink) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.ink")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.ink", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/ink.pyx":11 + * # MIT License + * #------------------------------------------------------------------------------ + * import re # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":25 + * # `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it + * #------------------------------------------------------------------------------ + * class Template(str): # <<<<<<<<<<<<<< + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type)))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Template, __pyx_n_s_Template, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Template___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__6); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list, 0, __pyx_n_s_Template__make_var_list, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_make_var_list, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars, 0, __pyx_n_s_Template__escape_regex_special_c, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_escape_regex_special_chars, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":25 + * # `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it + * #------------------------------------------------------------------------------ + * class Template(str): # <<<<<<<<<<<<<< + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Template, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Template, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":67 + * #------------------------------------------------------------------------------ + * + * class Renderer: # <<<<<<<<<<<<<< + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel + */ + __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Renderer, __pyx_n_s_Renderer, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__, 0, __pyx_n_s_Renderer___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__14); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render, 0, __pyx_n_s_Renderer_render, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_render, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":67 + * #------------------------------------------------------------------------------ + * + * class Renderer: # <<<<<<<<<<<<<< + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Renderer, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Renderer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":102 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # template = Template("This is a of the {{test}} of the {{document}} {{type}} and more of the {{test}} {{document}} {{type}}") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/ink.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.ink", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.ink"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.pyx new file mode 100644 index 00000000..2e9934ec --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/ink.pyx @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +#------------------------------------------------------------------------------ +# The Ink Templating System +# A lightweight, fast, flexible text templating system +# Copyright 2014 Christopher Simpkins +# MIT License +#------------------------------------------------------------------------------ +import re + +#------------------------------------------------------------------------------ +# Template class +# A template string class that is inherited from Python str +# Includes metadata about the template: +# odel = opening delimiter +# cdel = closing delimiter +# varlist = inclusive list of all variables in the template text (parsed in constructor) +# Delimiters: +# default = {{variable}} +# assign new opening and closing delimiters as parameters when you make a new Template instance +# `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it +#------------------------------------------------------------------------------ +class Template(str): + def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + obj = str.__new__(cls, template_text) + obj.odel = open_delimiter + obj.cdel = close_delimiter + obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + return obj + + #------------------------------------------------------------------------------ + # [ _make_var_list method ] (list of strings) + # Private method that parses the template string for all variables that match the delimiter pattern + # Returns a list of the variable names as strings + #------------------------------------------------------------------------------ + def _make_var_list(self, template_text, escape_regex=False): + if escape_regex: + open_match_pat = self._escape_regex_special_chars(self.odel) + close_match_pat = self._escape_regex_special_chars(self.cdel) + match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + else: + match_pat = self.odel + r'(.*?)' + self.cdel + var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + + #------------------------------------------------------------------------------ + # [ _escape_regex_special_chars method ] (string) + # Private method that escapes special regex metacharacters + # Returns a string with the escaped character modifications + #------------------------------------------------------------------------------ + def _escape_regex_special_chars(self, test_escape_string): + return re.escape(test_escape_string) + +#------------------------------------------------------------------------------ +# Renderer class +# Render the variable replacements in the ink template using a Python dictionary key argument +# Construct the instace of the Renderer with the Ink template and the dictionary key +# Run the renderer with the render method on the instance (e.g. r.render()) +# Parameters to constructor: +# - template = an Ink Template instance +# - key = a dictionary mapped key = variable name : value = variable replacement data +# - html_entities = encode html entities with HTML escaped characters (default = False = do not encode) +#------------------------------------------------------------------------------ + +class Renderer: + def __init__(self, template, key, html_entities=False): + self.odel = template.odel + self.cdel = template.cdel + self.template = template + self.html_entities = html_entities + self.key_dict = key + + #------------------------------------------------------------------------------ + # [ render method ] (string) + # renders the variable replacements in the Ink template + # returns the rendered template as a string + #------------------------------------------------------------------------------ + def render(self): + # make local variables for the loop below (faster) + local_dict = self.key_dict + local_template = self.template + local_varlist = self.template.varlist + local_odel = self.odel + local_cdel = self.cdel + local_htmlent = self.html_entities + if local_htmlent: + from xml.sax.saxutils import escape #from Python std lib + for key in local_dict: + if key in local_varlist: + value = local_dict[key] + replace_string = local_odel + key + local_cdel + if local_htmlent: + value = escape(value) #xml.sax.saxutils function + local_template = local_template.replace(replace_string, value) + return local_template + + ##TODO : multiple file render method? + + +if __name__ == '__main__': + pass + # template = Template("This is a of the {{test}} of the {{document}} {{type}} and more of the {{test}} {{document}} {{type}}") + # renderer = Renderer(template, {'test': 'ব য', 'document':'testing document', 'type':'of mine', 'bogus': 'bogus test'}) + # print(renderer.render()) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.c new file mode 100644 index 00000000..1e6857dc --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.c @@ -0,0 +1,10338 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:14 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__network +#define __PYX_HAVE_API__lib__Naked__toolshed__c__network +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "network.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.network' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.network" +int __pyx_module_is_main_lib__Naked__toolshed__c__network = 0; + +/* Implementation of 'lib.Naked.toolshed.c.network' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_open; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_request_timeout); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_4get_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_6get_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_8get_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_10head(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_12post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_14post_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_16post_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_18post_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_20response(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_22get_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_24post_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_[] = ""; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_w[] = "w"; +static char __pyx_k__2[] = "/"; +static char __pyx_k__4[] = "..."; +static char __pyx_k__6[] = " "; +static char __pyx_k_ce[] = "ce"; +static char __pyx_k_ok[] = "ok"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_wb[] = "wb"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_res[] = "res"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_url[] = "url"; +static char __pyx_k_HTTP[] = "HTTP"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_head[] = "head"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_open[] = "open"; +static char __pyx_k_post[] = "post"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_text[] = "text"; +static char __pyx_k_chunk[] = "chunk"; +static char __pyx_k_codes[] = "codes"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_flush[] = "flush"; +static char __pyx_k_fsync[] = "fsync"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_codecs[] = "codecs"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_exit_2[] = "exit"; +static char __pyx_k_fileno[] = "fileno"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_stream[] = "stream"; +static char __pyx_k_content[] = "content"; +static char __pyx_k_get_bin[] = "get_bin"; +static char __pyx_k_headers[] = "headers"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_timeout[] = "timeout"; +static char __pyx_k_HTTP_get[] = "HTTP.get"; +static char __pyx_k_encoding[] = "encoding"; +static char __pyx_k_filepath[] = "filepath"; +static char __pyx_k_post_bin[] = "post_bin"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_requests[] = "requests"; +static char __pyx_k_response[] = "response"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_HTTP_head[] = "HTTP.head"; +static char __pyx_k_HTTP_post[] = "HTTP.post"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_chunk_size[] = "chunk_size"; +static char __pyx_k_exceptions[] = "exceptions"; +static char __pyx_k_HTTP___init[] = "HTTP.__init__"; +static char __pyx_k_file_exists[] = "file_exists"; +static char __pyx_k_status_code[] = "status_code"; +static char __pyx_k_HTTP_get_bin[] = "HTTP.get_bin"; +static char __pyx_k_iter_content[] = "iter_content"; +static char __pyx_k_HTTP_post_bin[] = "HTTP.post_bin"; +static char __pyx_k_HTTP_response[] = "HTTP.response"; +static char __pyx_k_get_status_ok[] = "get_status_ok"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_post_status_ok[] = "post_status_ok"; +static char __pyx_k_ConnectionError[] = "ConnectionError"; +static char __pyx_k_allow_redirects[] = "allow_redirects"; +static char __pyx_k_request_timeout[] = "request_timeout"; +static char __pyx_k_suppress_output[] = "suppress_output"; +static char __pyx_k_follow_redirects[] = "follow_redirects"; +static char __pyx_k_Download_complete[] = "Download complete."; +static char __pyx_k_HTTP_get_status_ok[] = "HTTP.get_status_ok"; +static char __pyx_k_get_bin_write_file[] = "get_bin_write_file"; +static char __pyx_k_get_txt_write_file[] = "get_txt_write_file"; +static char __pyx_k_overwrite_existing[] = "overwrite_existing"; +static char __pyx_k_HTTP_post_status_ok[] = "HTTP.post_status_ok"; +static char __pyx_k_post_bin_write_file[] = "post_bin_write_file"; +static char __pyx_k_post_txt_write_file[] = "post_txt_write_file"; +static char __pyx_k_Downloading_file_from[] = "Downloading file from "; +static char __pyx_k_Naked_toolshed_system[] = "Naked.toolshed.system"; +static char __pyx_k_HTTP_get_bin_write_file[] = "HTTP.get_bin_write_file"; +static char __pyx_k_HTTP_get_txt_write_file[] = "HTTP.get_txt_write_file"; +static char __pyx_k_HTTP_post_bin_write_file[] = "HTTP.post_bin_write_file"; +static char __pyx_k_HTTP_post_txt_write_file[] = "HTTP.post_txt_write_file"; +static char __pyx_k_lib_Naked_toolshed_c_network[] = "lib.Naked.toolshed.c.network"; +static char __pyx_k_Naked_Framework_Error_Unable_to[] = "Naked Framework Error: Unable to perform GET request with the URL "; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/network.pyx"; +static char __pyx_k_using_the_get_bin_write_file_me[] = " using the get_bin_write_file() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_get_data_method_Naked[] = " using the get_data() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_get_data_write_txt_me[] = " using the get_data_write_txt() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_get_method_Naked_tool[] = " using the get() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_post_data_write_bin_m[] = " using the post_data_write_bin() method (Naked.toolshed.network.py)"; +static char __pyx_k_Download_aborted_A_local_file_wi[] = "Download aborted. A local file with the requested filename exists on the path."; +static char __pyx_k_Naked_Framework_Error_Unable_to_2[] = "Naked Framework Error: Unable to perform GET request and write file with the URL "; +static char __pyx_k_Naked_Framework_Error_Unable_to_3[] = "Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_4[] = "Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_5[] = "Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_6[] = "Naked Framework Error: Unable to perform POST request and write file with the URL "; +static char __pyx_k_Naked_Framework_Error_Unable_to_7[] = "Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_8[] = "Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_9[] = "Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py)."; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ConnectionError; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_kp_s_Download_aborted_A_local_file_wi; +static PyObject *__pyx_kp_s_Download_complete; +static PyObject *__pyx_kp_s_Downloading_file_from; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_HTTP; +static PyObject *__pyx_n_s_HTTP___init; +static PyObject *__pyx_n_s_HTTP_get; +static PyObject *__pyx_n_s_HTTP_get_bin; +static PyObject *__pyx_n_s_HTTP_get_bin_write_file; +static PyObject *__pyx_n_s_HTTP_get_status_ok; +static PyObject *__pyx_n_s_HTTP_get_txt_write_file; +static PyObject *__pyx_n_s_HTTP_head; +static PyObject *__pyx_n_s_HTTP_post; +static PyObject *__pyx_n_s_HTTP_post_bin; +static PyObject *__pyx_n_s_HTTP_post_bin_write_file; +static PyObject *__pyx_n_s_HTTP_post_status_ok; +static PyObject *__pyx_n_s_HTTP_post_txt_write_file; +static PyObject *__pyx_n_s_HTTP_response; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_9; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_system; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_n_s_allow_redirects; +static PyObject *__pyx_n_s_ce; +static PyObject *__pyx_n_s_chunk; +static PyObject *__pyx_n_s_chunk_size; +static PyObject *__pyx_n_s_codecs; +static PyObject *__pyx_n_s_codes; +static PyObject *__pyx_n_s_content; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exceptions; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_exit_2; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_file_exists; +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_n_s_filepath; +static PyObject *__pyx_n_s_flush; +static PyObject *__pyx_n_s_follow_redirects; +static PyObject *__pyx_n_s_fsync; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_bin; +static PyObject *__pyx_n_s_get_bin_write_file; +static PyObject *__pyx_n_s_get_status_ok; +static PyObject *__pyx_n_s_get_txt_write_file; +static PyObject *__pyx_n_s_head; +static PyObject *__pyx_n_s_headers; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_iter_content; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_network; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_ok; +static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_overwrite_existing; +static PyObject *__pyx_n_s_post; +static PyObject *__pyx_n_s_post_bin; +static PyObject *__pyx_n_s_post_bin_write_file; +static PyObject *__pyx_n_s_post_status_ok; +static PyObject *__pyx_n_s_post_txt_write_file; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_request_timeout; +static PyObject *__pyx_n_s_requests; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_n_s_response; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_status_code; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_stream; +static PyObject *__pyx_n_s_suppress_output; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_text; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_url; +static PyObject *__pyx_kp_s_using_the_get_bin_write_file_me; +static PyObject *__pyx_kp_s_using_the_get_data_method_Naked; +static PyObject *__pyx_kp_s_using_the_get_data_write_txt_me; +static PyObject *__pyx_kp_s_using_the_get_method_Naked_tool; +static PyObject *__pyx_kp_s_using_the_post_data_write_bin_m; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_wb; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_2048; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; + +/* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_request_timeout = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_url,&__pyx_n_s_request_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)__pyx_int_10)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_url); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_request_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_url = values[1]; + __pyx_v_request_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP___init__(__pyx_self, __pyx_v_self, __pyx_v_url, __pyx_v_request_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_request_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/network.pyx":16 + * class HTTP(): + * def __init__(self, url="", request_timeout=10): + * self.url = url # <<<<<<<<<<<<<< + * self.request_timeout = request_timeout + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_url, __pyx_v_url) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":17 + * def __init__(self, url="", request_timeout=10): + * self.url = url + * self.request_timeout = request_timeout # <<<<<<<<<<<<<< + * #------------------------------------------------------------------------------ + * # HTTP response properties (assignment occurs with the HTTP request methods) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout, __pyx_v_request_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":21 + * # HTTP response properties (assignment occurs with the HTTP request methods) + * #------------------------------------------------------------------------------ + * self.res = None # assigned with the requests external library response object after a HTTP method call # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get = {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_follow_redirects = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_follow_redirects,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_True)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow_redirects); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_follow_redirects = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_2get(__pyx_self, __pyx_v_self, __pyx_v_follow_redirects); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + + /* "lib/Naked/toolshed/c/network.pyx":33 + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): + * try: # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":34 + * def get(self, follow_redirects=True): + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allow_redirects, __pyx_v_follow_redirects) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":35 + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.text + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":36 + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_text); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":37 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":38 + * return response.text + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":39 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":40 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":41 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_kp_s_using_the_get_method_Naked_tool); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":42 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin = {__Pyx_NAMESTR("get_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_bin (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_4get_bin(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_4get_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_bin", 0); + + /* "lib/Naked/toolshed/c/network.pyx":50 + * #------------------------------------------------------------------------------ + * def get_bin(self): + * try: # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":51 + * def get_bin(self): + * try: + * response = requests.get(self.url, timeout=self.request_timeout) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance + * return response.content # return binary data instead of text (get() returns text) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":52 + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance # <<<<<<<<<<<<<< + * return response.content # return binary data instead of text (get() returns text) + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":53 + * response = requests.get(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance + * return response.content # return binary data instead of text (get() returns text) # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":54 + * self.res = response # assign the response object from requests to a property on the instance + * return response.content # return binary data instead of text (get() returns text) + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":55 + * return response.content # return binary data instead of text (get() returns text) + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":56 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":57 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":58 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_kp_s_using_the_get_data_method_Naked); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":59 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file = {__Pyx_NAMESTR("get_bin_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_bin_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_bin_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_bin_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_6get_bin_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_6get_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_bin_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":70 + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":71 + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":73 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":74 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":75 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":76 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":77 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":78 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":79 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":80 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":81 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":82 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":83 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":84 + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":85 + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":86 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*with:*/ { + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":87 + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) { + __pyx_t_10 = __pyx_t_11; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_11 = __pyx_t_16(__pyx_t_10); + if (unlikely(!__pyx_t_11)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_11); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_11); + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":88 + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":89 + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":90 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":86 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_4); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__5, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":91 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":92 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":93 + * if not suppress_output: + * print(" ") + * print("Download complete.") # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":94 + * print(" ") + * print("Download complete.") + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":95 + * print("Download complete.") + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_ce = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":96 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":97 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_e = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":98 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":99 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_get_bin_write_file_me); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":100 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file = {__Pyx_NAMESTR("get_txt_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_txt_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_txt_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_txt_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_8get_txt_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_8get_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_txt_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":110 + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":111 + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":113 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":114 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":115 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":116 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":117 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":118 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":119 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":120 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":121 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":122 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":123 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":124 + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * import codecs + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":125 + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":126 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): + */ + __pyx_t_11 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_codecs = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":127 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*with:*/ { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encoding, __pyx_kp_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_10); + __pyx_v_f = __pyx_t_10; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":128 + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * chunk = chunk.decode('utf-8') + * f.write(chunk) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_16(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":129 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_chunk, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":130 + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":131 + * chunk = chunk.decode('utf-8') + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":132 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":127 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_10, __pyx_t_11); + __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__9, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":133 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":134 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":135 + * if not suppress_output: + * print(" ") + * print("Download complete.") # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":136 + * print(" ") + * print("Download complete.") + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":137 + * print("Download complete.") + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_ce = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":138 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":139 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_e = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":140 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":141 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_get_data_write_txt_me); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":142 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head = {__Pyx_NAMESTR("head"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("head (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_10head(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_10head(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("head", 0); + + /* "lib/Naked/toolshed/c/network.pyx":154 + * #------------------------------------------------------------------------------ + * def head(self): + * try: # <<<<<<<<<<<<<< + * response = requests.head(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":155 + * def head(self): + * try: + * response = requests.head(self.url, timeout=self.request_timeout) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.headers + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_head); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":156 + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.headers + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":157 + * response = requests.head(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.headers # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_headers); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":158 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.headers + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.head", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":159 + * return response.headers + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":160 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.head", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":161 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":162 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":163 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.head", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post = {__Pyx_NAMESTR("post"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_follow_redirects = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_follow_redirects,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_True)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow_redirects); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "post") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_follow_redirects = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("post", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_12post(__pyx_self, __pyx_v_self, __pyx_v_follow_redirects); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_12post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post", 0); + + /* "lib/Naked/toolshed/c/network.pyx":172 + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): + * try: # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":173 + * def post(self, follow_redirects=True): + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_post); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allow_redirects, __pyx_v_follow_redirects) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":174 + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.text + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":175 + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_text); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":176 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":177 + * return response.text + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":178 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":179 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":180 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":181 + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin = {__Pyx_NAMESTR("post_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_bin (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_14post_bin(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_14post_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_bin", 0); + + /* "lib/Naked/toolshed/c/network.pyx":189 + * #------------------------------------------------------------------------------ + * def post_bin(self): + * try: # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":190 + * def post_bin(self): + * try: + * response = requests.post(self.url, timeout=self.request_timeout) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.content + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_post); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":191 + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.content + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":192 + * response = requests.post(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.content # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":193 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.content + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":194 + * return response.content + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":195 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":196 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":197 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":198 + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file = {__Pyx_NAMESTR("post_bin_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_bin_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "post_bin_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("post_bin_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_16post_bin_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_16post_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_bin_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":207 + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":208 + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":210 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":211 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":212 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":213 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":214 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":215 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":216 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":217 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":218 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":219 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":220 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":221 + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_post); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":222 + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":223 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*with:*/ { + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":224 + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) { + __pyx_t_10 = __pyx_t_11; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_11 = __pyx_t_16(__pyx_t_10); + if (unlikely(!__pyx_t_11)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_11); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_11); + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":225 + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":226 + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":227 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":223 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_4); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__14, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":228 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") # provide user with completion information + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":229 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":230 + * if not suppress_output: + * print(" ") + * print("Download complete.") # provide user with completion information # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":231 + * print(" ") + * print("Download complete.") # provide user with completion information + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":232 + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_ce = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":233 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":234 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_e = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":235 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":236 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_post_data_write_bin_m); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":237 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file = {__Pyx_NAMESTR("post_txt_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_txt_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "post_txt_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("post_txt_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_18post_txt_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_18post_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_txt_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":246 + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":247 + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":249 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":250 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":251 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":252 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":253 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":254 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":255 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":256 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":257 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":258 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":259 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":260 + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * import codecs + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_post); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":261 + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":262 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + */ + __pyx_t_11 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_codecs = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":263 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*with:*/ { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encoding, __pyx_kp_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_10); + __pyx_v_f = __pyx_t_10; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":264 + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * chunk = chunk.decode('utf-8') + * f.write(chunk) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_16(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":265 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_chunk, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":266 + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":267 + * chunk = chunk.decode('utf-8') + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":268 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":263 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_10, __pyx_t_11); + __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__17, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":269 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") # provide user with completion information + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":270 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":271 + * if not suppress_output: + * print(" ") + * print("Download complete.") # provide user with completion information # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":272 + * print(" ") + * print("Download complete.") # provide user with completion information + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":273 + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_ce = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":274 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":275 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_e = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":276 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":277 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_post_data_write_bin_m); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":278 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response = {__Pyx_NAMESTR("response"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("response (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_20response(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_20response(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("response", 0); + + /* "lib/Naked/toolshed/c/network.pyx":288 + * #------------------------------------------------------------------------------ + * def response(self): + * try: # <<<<<<<<<<<<<< + * return self.res + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":289 + * def response(self): + * try: + * return self.res # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":290 + * try: + * return self.res + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + */ + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_5) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.response", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/network.pyx":291 + * return self.res + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":292 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":293 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.response", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok = {__Pyx_NAMESTR("get_status_ok"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_status_ok (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_22get_status_ok(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_22get_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_status_ok", 0); + + /* "lib/Naked/toolshed/c/network.pyx":302 + * #------------------------------------------------------------------------------ + * def get_status_ok(self): + * try: # <<<<<<<<<<<<<< + * self.get() #run the get request + * if self.res and self.res.status_code: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":303 + * def get_status_ok(self): + * try: + * self.get() #run the get request # <<<<<<<<<<<<<< + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":304 + * try: + * self.get() #run the get request + * if self.res and self.res.status_code: # <<<<<<<<<<<<<< + * return (self.res.status_code == requests.codes.ok) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_status_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":305 + * self.get() #run the get request + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_status_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_codes); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/network.pyx":307 + * return (self.res.status_code == requests.codes.ok) + * else: + * return False # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":308 + * else: + * return False + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":309 + * return False + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":310 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":311 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":312 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/network.pyx":313 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok = {__Pyx_NAMESTR("post_status_ok"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_status_ok (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_24post_status_ok(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_24post_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_status_ok", 0); + + /* "lib/Naked/toolshed/c/network.pyx":321 + * #------------------------------------------------------------------------------ + * def post_status_ok(self): + * try: # <<<<<<<<<<<<<< + * self.post() #run the post request + * if self.res and self.res.status_code: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":322 + * def post_status_ok(self): + * try: + * self.post() #run the post request # <<<<<<<<<<<<<< + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_post); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":323 + * try: + * self.post() #run the post request + * if self.res and self.res.status_code: # <<<<<<<<<<<<<< + * return (self.res.status_code == requests.codes.ok) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_status_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":324 + * self.post() #run the post request + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_status_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_codes); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/network.pyx":326 + * return (self.res.status_code == requests.codes.ok) + * else: + * return False # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":327 + * else: + * return False + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":328 + * return False + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":329 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":330 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":331 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/network.pyx":332 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("network"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_kp_s_Download_aborted_A_local_file_wi, __pyx_k_Download_aborted_A_local_file_wi, sizeof(__pyx_k_Download_aborted_A_local_file_wi), 0, 0, 1, 0}, + {&__pyx_kp_s_Download_complete, __pyx_k_Download_complete, sizeof(__pyx_k_Download_complete), 0, 0, 1, 0}, + {&__pyx_kp_s_Downloading_file_from, __pyx_k_Downloading_file_from, sizeof(__pyx_k_Downloading_file_from), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP, __pyx_k_HTTP, sizeof(__pyx_k_HTTP), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP___init, __pyx_k_HTTP___init, sizeof(__pyx_k_HTTP___init), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get, __pyx_k_HTTP_get, sizeof(__pyx_k_HTTP_get), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_bin, __pyx_k_HTTP_get_bin, sizeof(__pyx_k_HTTP_get_bin), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_bin_write_file, __pyx_k_HTTP_get_bin_write_file, sizeof(__pyx_k_HTTP_get_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_status_ok, __pyx_k_HTTP_get_status_ok, sizeof(__pyx_k_HTTP_get_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_txt_write_file, __pyx_k_HTTP_get_txt_write_file, sizeof(__pyx_k_HTTP_get_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_head, __pyx_k_HTTP_head, sizeof(__pyx_k_HTTP_head), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post, __pyx_k_HTTP_post, sizeof(__pyx_k_HTTP_post), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_bin, __pyx_k_HTTP_post_bin, sizeof(__pyx_k_HTTP_post_bin), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_bin_write_file, __pyx_k_HTTP_post_bin_write_file, sizeof(__pyx_k_HTTP_post_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_status_ok, __pyx_k_HTTP_post_status_ok, sizeof(__pyx_k_HTTP_post_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_txt_write_file, __pyx_k_HTTP_post_txt_write_file, sizeof(__pyx_k_HTTP_post_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_response, __pyx_k_HTTP_response, sizeof(__pyx_k_HTTP_response), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_k_Naked_Framework_Error_Unable_to, sizeof(__pyx_k_Naked_Framework_Error_Unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_k_Naked_Framework_Error_Unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_3, __pyx_k_Naked_Framework_Error_Unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_4, __pyx_k_Naked_Framework_Error_Unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_5, __pyx_k_Naked_Framework_Error_Unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_k_Naked_Framework_Error_Unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_7, __pyx_k_Naked_Framework_Error_Unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_8, __pyx_k_Naked_Framework_Error_Unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_9, __pyx_k_Naked_Framework_Error_Unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_9), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_system, __pyx_k_Naked_toolshed_system, sizeof(__pyx_k_Naked_toolshed_system), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_n_s_allow_redirects, __pyx_k_allow_redirects, sizeof(__pyx_k_allow_redirects), 0, 0, 1, 1}, + {&__pyx_n_s_ce, __pyx_k_ce, sizeof(__pyx_k_ce), 0, 0, 1, 1}, + {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, + {&__pyx_n_s_chunk_size, __pyx_k_chunk_size, sizeof(__pyx_k_chunk_size), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_s_codes, __pyx_k_codes, sizeof(__pyx_k_codes), 0, 0, 1, 1}, + {&__pyx_n_s_content, __pyx_k_content, sizeof(__pyx_k_content), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_exit_2, __pyx_k_exit_2, sizeof(__pyx_k_exit_2), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1}, + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, + {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, + {&__pyx_n_s_follow_redirects, __pyx_k_follow_redirects, sizeof(__pyx_k_follow_redirects), 0, 0, 1, 1}, + {&__pyx_n_s_fsync, __pyx_k_fsync, sizeof(__pyx_k_fsync), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_bin, __pyx_k_get_bin, sizeof(__pyx_k_get_bin), 0, 0, 1, 1}, + {&__pyx_n_s_get_bin_write_file, __pyx_k_get_bin_write_file, sizeof(__pyx_k_get_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_get_status_ok, __pyx_k_get_status_ok, sizeof(__pyx_k_get_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_get_txt_write_file, __pyx_k_get_txt_write_file, sizeof(__pyx_k_get_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1}, + {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_iter_content, __pyx_k_iter_content, sizeof(__pyx_k_iter_content), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_network, __pyx_k_lib_Naked_toolshed_c_network, sizeof(__pyx_k_lib_Naked_toolshed_c_network), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_ok, __pyx_k_ok, sizeof(__pyx_k_ok), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_overwrite_existing, __pyx_k_overwrite_existing, sizeof(__pyx_k_overwrite_existing), 0, 0, 1, 1}, + {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1}, + {&__pyx_n_s_post_bin, __pyx_k_post_bin, sizeof(__pyx_k_post_bin), 0, 0, 1, 1}, + {&__pyx_n_s_post_bin_write_file, __pyx_k_post_bin_write_file, sizeof(__pyx_k_post_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_post_status_ok, __pyx_k_post_status_ok, sizeof(__pyx_k_post_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_post_txt_write_file, __pyx_k_post_txt_write_file, sizeof(__pyx_k_post_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_request_timeout, __pyx_k_request_timeout, sizeof(__pyx_k_request_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_requests, __pyx_k_requests, sizeof(__pyx_k_requests), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_status_code, __pyx_k_status_code, sizeof(__pyx_k_status_code), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_output, __pyx_k_suppress_output, sizeof(__pyx_k_suppress_output), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1}, + {&__pyx_kp_s_using_the_get_bin_write_file_me, __pyx_k_using_the_get_bin_write_file_me, sizeof(__pyx_k_using_the_get_bin_write_file_me), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_get_data_method_Naked, __pyx_k_using_the_get_data_method_Naked, sizeof(__pyx_k_using_the_get_data_method_Naked), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_get_data_write_txt_me, __pyx_k_using_the_get_data_write_txt_me, sizeof(__pyx_k_using_the_get_data_write_txt_me), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_get_method_Naked_tool, __pyx_k_using_the_get_method_Naked_tool, sizeof(__pyx_k_using_the_get_method_Naked_tool), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_post_data_write_bin_m, __pyx_k_using_the_post_data_write_bin_m, sizeof(__pyx_k_using_the_post_data_write_bin_m), 0, 0, 1, 0}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/network.pyx":80 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/network.pyx":86 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/network.pyx":120 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/network.pyx":129 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "lib/Naked/toolshed/c/network.pyx":127 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/network.pyx":162 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_3); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/network.pyx":180 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_4); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/network.pyx":197 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_5); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/network.pyx":217 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "lib/Naked/toolshed/c/network.pyx":223 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + __pyx_tuple__14 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/network.pyx":256 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/network.pyx":265 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/network.pyx":263 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + __pyx_tuple__17 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "lib/Naked/toolshed/c/network.pyx":292 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_7); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/network.pyx":312 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_8); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "lib/Naked/toolshed/c/network.pyx":331 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_9); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_url, __pyx_n_s_request_timeout); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__23 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s_), ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_follow_redirects, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__26 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_bin, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__29 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_bin_write_file, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__31 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__32 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_txt_write_file, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__34 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_head, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_follow_redirects, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__39 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_bin, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__42 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_bin_write_file, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__44 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__45 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_txt_write_file, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__47 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_response, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_status_ok, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_status_ok, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2048 = PyInt_FromLong(2048); if (unlikely(!__pyx_int_2048)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initnetwork(void); /*proto*/ +PyMODINIT_FUNC initnetwork(void) +#else +PyMODINIT_FUNC PyInit_network(void); /*proto*/ +PyMODINIT_FUNC PyInit_network(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_network(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("network"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__network) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.network")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.network", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/network.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * import requests + * from Naked.settings import debug as DEBUG_FLAG + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":6 + * + * import sys + * import requests # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_requests, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_requests, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":7 + * import sys + * import requests + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":14 + * # Uses the requests external library to handle HTTP requests and response object (available on PyPI) + * #------------------------------------------------------------------------------ + * class HTTP(): # <<<<<<<<<<<<<< + * def __init__(self, url="", request_timeout=10): + * self.url = url + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_HTTP, __pyx_n_s_HTTP, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_network, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__, 0, __pyx_n_s_HTTP___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__23); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get, 0, __pyx_n_s_HTTP_get, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__26); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin, 0, __pyx_n_s_HTTP_get_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_bin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file, 0, __pyx_n_s_HTTP_get_bin_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__31); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_bin_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file, 0, __pyx_n_s_HTTP_get_txt_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__34); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_txt_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head, 0, __pyx_n_s_HTTP_head, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_head, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post, 0, __pyx_n_s_HTTP_post, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__39); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin, 0, __pyx_n_s_HTTP_post_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_bin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file, 0, __pyx_n_s_HTTP_post_bin_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__44); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_bin_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file, 0, __pyx_n_s_HTTP_post_txt_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__47); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_txt_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response, 0, __pyx_n_s_HTTP_response, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_response, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok, 0, __pyx_n_s_HTTP_get_status_ok, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_status_ok, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok, 0, __pyx_n_s_HTTP_post_status_ok, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_status_ok, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":14 + * # Uses the requests external library to handle HTTP requests and response object (available on PyPI) + * #------------------------------------------------------------------------------ + * class HTTP(): # <<<<<<<<<<<<<< + * def __init__(self, url="", request_timeout=10): + * self.url = url + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_HTTP, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HTTP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":334 + * raise e + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * #------------------------------------------------------------------------------ + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/network.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.network", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.network"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.pyx new file mode 100644 index 00000000..34dadafb --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/network.pyx @@ -0,0 +1,352 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +import requests +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +#[ HTTP class] +# handle HTTP requests +# Uses the requests external library to handle HTTP requests and response object (available on PyPI) +#------------------------------------------------------------------------------ +class HTTP(): + def __init__(self, url="", request_timeout=10): + self.url = url + self.request_timeout = request_timeout + #------------------------------------------------------------------------------ + # HTTP response properties (assignment occurs with the HTTP request methods) + #------------------------------------------------------------------------------ + self.res = None # assigned with the requests external library response object after a HTTP method call + + #------------------------------------------------------------------------------ + # [ get method ] (string) - + # HTTP GET request - returns text string + # returns data stream read from the URL (string) + # Default timeout = 10 s from class constructor + # Re-throws ConnectionError on failed connection (e.g. no site at URL) + # Test : test_NETWORK.py :: test_http_get, test_http_get_response_change, + # test_http_post_reponse_change, test_http_get_response_check + #------------------------------------------------------------------------------ + def get(self, follow_redirects=True): + try: + response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_data method ] (binary data) + # HTTP GET request, return binary data + # returns data stream with raw binary data + #------------------------------------------------------------------------------ + def get_bin(self): + try: + response = requests.get(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance + return response.content # return binary data instead of text (get() returns text) + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_bin_write_file method ] (boolean) + # open HTTP data stream with GET request, make file with the returned binary data + # file path is passed to the method by the developer + # set suppress_output to True if you want to suppress the d/l status information that is printed to the standard output stream + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_binary + #------------------------------------------------------------------------------ + def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_txt_write_file method ] (boolean) + # open HTTP data stream with GET request, write file with utf-8 encoded text using returned text data + # file path is passed to the method by the developer (default is the base filename in the URL if not specified) + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_text + #------------------------------------------------------------------------------ + def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ head method ] (dictionary of strings) + # HTTP HEAD request + # returns a dictionary of the header strings + # test for a specific header on either the response dictionary or the instance res property + # Usage example: + # content_type = instance.res['content-type'] + # Tests: test_NETWORK.py :: test_http_head + #------------------------------------------------------------------------------ + def head(self): + try: + response = requests.head(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.headers + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ post method ] (string) + # HTTP POST request for text + # returns text from the URL as a string + #------------------------------------------------------------------------------ + def post(self, follow_redirects=True): + try: + response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin method ] (binary data) + # HTTP POST request for binary data + # returns binary data from the URL + #------------------------------------------------------------------------------ + def post_bin(self): + try: + response = requests.post(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.content + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin_write_file method ] (boolean = success of write) + # HTTP POST request, write binary file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ post_txt_write_file method ] (boolean = success of file write) + # HTTP POST request, write utf-8 encoded text file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ response method ] + # getter method for the requests library object that is assigned as a property + # on the HTTP class after a HTTP request method is run (e.g. get()) + # Note: must run one of the HTTP request verbs to assign this property before use of getter (=None by default) + # Tests: test_NETWORK.py :: test_http_get_response_check + #------------------------------------------------------------------------------ + def response(self): + try: + return self.res + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ get_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for GET request + # Note: this method runs its own GET request, does not need to be run separately + # Tests: test_NETWORK.py :: + #------------------------------------------------------------------------------ + def get_status_ok(self): + try: + self.get() #run the get request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for POST request + # Note: method runs its own post method, not necessary to run separately + #------------------------------------------------------------------------------ + def post_status_ok(self): + try: + self.post() #run the post request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + raise e + +if __name__ == '__main__': + pass + #------------------------------------------------------------------------------ + # HTTP GET 1 + #------------------------------------------------------------------------------ + # http = HTTP("http://www.google.com") + # data = http.get() + # print(data) + # from Naked.toolshed.file import FileWriter + # w = FileWriter("testfile.txt") + # w.write_utf8(data) + #------------------------------------------------------------------------------ + # HTTP GET 2 + #------------------------------------------------------------------------------ + # http = HTTP() + # http.url = "http://www.google.com" + # print(http.get()) + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.c new file mode 100644 index 00000000..e1a7e9ca --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.c @@ -0,0 +1,2650 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:15 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__python +#define __PYX_HAVE_API__lib__Naked__toolshed__c__python +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "python.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#ifndef CYTHON_PROFILE + #define CYTHON_PROFILE 1 +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL Py_CLEAR(__pyx_frame) + #endif + #define __Pyx_TraceDeclarations \ + static PyCodeObject *__pyx_frame_code = NULL; \ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ + if (unlikely(PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) { \ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ + } + #define __Pyx_TraceException() \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + PyObject *exc_info = __Pyx_GetExceptionTuple(); \ + if (exc_info) { \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + Py_DECREF(exc_info); \ + } \ + tstate->use_tracing = 1; \ + } + #define __Pyx_TraceReturn(result) \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + if (tstate->c_profilefunc) \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + CYTHON_FRAME_DEL; \ + tstate->use_tracing = 1; \ + } + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result) +#endif /* CYTHON_PROFILE */ +#if CYTHON_TRACE + #define __Pyx_TraceLine(lineno) \ + if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + __pyx_frame->f_lineno = lineno; \ + tstate->use_tracing = 0; \ + tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL); \ + tstate->use_tracing = 1; \ + } +#else + #define __Pyx_TraceLine(lineno) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.python' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.python" +int __pyx_module_is_main_lib__Naked__toolshed__c__python = 0; + +/* Implementation of 'lib.Naked.toolshed.c.python' */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_py_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_2py_major_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_4py_minor_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_6py_patch_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_8is_py2(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_10is_py3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_py2[] = "is_py2"; +static char __pyx_k_is_py3[] = "is_py3"; +static char __pyx_k_py_version[] = "py_version"; +static char __pyx_k_version_info[] = "version_info"; +static char __pyx_k_py_major_version[] = "py_major_version"; +static char __pyx_k_py_minor_version[] = "py_minor_version"; +static char __pyx_k_py_patch_version[] = "py_patch_version"; +static char __pyx_k_lib_Naked_toolshed_c_python[] = "lib.Naked.toolshed.c.python"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/python.pyx"; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_is_py2; +static PyObject *__pyx_n_s_is_py3; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_python; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_py_major_version; +static PyObject *__pyx_n_s_py_minor_version; +static PyObject *__pyx_n_s_py_patch_version; +static PyObject *__pyx_n_s_py_version; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_codeobj_; +static PyObject *__pyx_codeobj__2; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__6; + +/* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_1py_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_1py_version = {__Pyx_NAMESTR("py_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_1py_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_1py_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_py_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_py_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_version", 0); + __Pyx_TraceCall("py_version", __pyx_f[0], 14); + + /* "lib/Naked/toolshed/c/python.pyx":15 + * #------------------------------------------------------------------------------ + * def py_version(): + * return (version_info[0], version_info[1], version_info[2]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_3py_major_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_3py_major_version = {__Pyx_NAMESTR("py_major_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_3py_major_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_3py_major_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_major_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_2py_major_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_2py_major_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_major_version", 0); + __Pyx_TraceCall("py_major_version", __pyx_f[0], 21); + + /* "lib/Naked/toolshed/c/python.pyx":22 + * #------------------------------------------------------------------------------ + * def py_major_version(): + * return (version_info[0]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_major_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_5py_minor_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_5py_minor_version = {__Pyx_NAMESTR("py_minor_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_5py_minor_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_5py_minor_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_minor_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_4py_minor_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_4py_minor_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_minor_version", 0); + __Pyx_TraceCall("py_minor_version", __pyx_f[0], 28); + + /* "lib/Naked/toolshed/c/python.pyx":29 + * #------------------------------------------------------------------------------ + * def py_minor_version(): + * return (version_info[1]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_minor_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_7py_patch_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_7py_patch_version = {__Pyx_NAMESTR("py_patch_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_7py_patch_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_7py_patch_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_patch_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_6py_patch_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_6py_patch_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_patch_version", 0); + __Pyx_TraceCall("py_patch_version", __pyx_f[0], 35); + + /* "lib/Naked/toolshed/c/python.pyx":36 + * #------------------------------------------------------------------------------ + * def py_patch_version(): + * return (version_info[2]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_patch_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_9is_py2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_9is_py2 = {__Pyx_NAMESTR("is_py2"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_9is_py2, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_9is_py2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_py2 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_8is_py2(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_8is_py2(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("is_py2", 0); + __Pyx_TraceCall("is_py2", __pyx_f[0], 42); + + /* "lib/Naked/toolshed/c/python.pyx":43 + * #------------------------------------------------------------------------------ + * def is_py2(): + * return (version_info[0] == (2)) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.is_py2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_11is_py3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_11is_py3 = {__Pyx_NAMESTR("is_py3"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_11is_py3, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_11is_py3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_py3 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_10is_py3(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_10is_py3(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("is_py3", 0); + __Pyx_TraceCall("is_py3", __pyx_f[0], 49); + + /* "lib/Naked/toolshed/c/python.pyx":50 + * #------------------------------------------------------------------------------ + * def is_py3(): + * return (version_info[0] == (3)) # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.is_py3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("python"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_is_py2, __pyx_k_is_py2, sizeof(__pyx_k_is_py2), 0, 0, 1, 1}, + {&__pyx_n_s_is_py3, __pyx_k_is_py3, sizeof(__pyx_k_is_py3), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_python, __pyx_k_lib_Naked_toolshed_c_python, sizeof(__pyx_k_lib_Naked_toolshed_c_python), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_py_major_version, __pyx_k_py_major_version, sizeof(__pyx_k_py_major_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_minor_version, __pyx_k_py_minor_version, sizeof(__pyx_k_py_minor_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_patch_version, __pyx_k_py_patch_version, sizeof(__pyx_k_py_patch_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_version, __pyx_k_py_version, sizeof(__pyx_k_py_version), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_version, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_major_version, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_minor_version, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_patch_version, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_py2, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_py3, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initpython(void); /*proto*/ +PyMODINIT_FUNC initpython(void) +#else +PyMODINIT_FUNC PyInit_python(void); /*proto*/ +PyMODINIT_FUNC PyInit_python(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_python(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("python"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__python) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.python")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.python", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/python.pyx":5 + * # cython: profile=True + * + * from sys import version_info # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_version_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info); + __Pyx_GIVEREF(__pyx_n_s_version_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_1py_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_3py_major_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_major_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_5py_minor_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_minor_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_7py_patch_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_patch_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_9is_py2, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_py2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_11is_py3, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_py3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":52 + * return (version_info[0] == (3)) + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/python.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=True + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.python", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.python"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + const char *funcname, + const char *srcfile, + int firstlineno) { + int retval; + PyThreadState* tstate = PyThreadState_GET(); + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + (*frame)->f_lineno = firstlineno; + tstate->use_tracing = 0; + #if CYTHON_TRACE + if (tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL); + if (!tstate->c_profilefunc) + retval = 1; + else + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + tstate->use_tracing = (tstate->c_profilefunc || + (CYTHON_TRACE && tstate->c_tracefunc)); + return tstate->use_tracing && retval; +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + PyCodeObject *py_code = 0; + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + py_srcfile = PyString_FromString(srcfile); + #else + py_funcname = PyUnicode_FromString(funcname); + py_srcfile = PyUnicode_FromString(srcfile); + #endif + if (!py_funcname | !py_srcfile) goto bad; + py_code = PyCode_New( + 0, /*int argcount,*/ + #if PY_MAJOR_VERSION >= 3 + 0, /*int kwonlyargcount,*/ + #endif + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return py_code; +} +#endif /* CYTHON_PROFILE */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.pyx new file mode 100644 index 00000000..7eaf8b62 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/python.pyx @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=True + +from sys import version_info + +#------------------------------------------------------------------------------ +# Python Versions +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ py_version function ] (tuple of (major, minor, patch)) +#------------------------------------------------------------------------------ +def py_version(): + return (version_info[0], version_info[1], version_info[2]) + +#------------------------------------------------------------------------------ +# [ py_major_version function ] (integer) +# Return Python interpreter major version number +#------------------------------------------------------------------------------ +def py_major_version(): + return (version_info[0]) + +#------------------------------------------------------------------------------ +# [ py_minor_version function ] (integer) +# Return Python interpreter minor version number +#------------------------------------------------------------------------------ +def py_minor_version(): + return (version_info[1]) + +#------------------------------------------------------------------------------ +# [ py_patch_version function ] (integer) +# Return Python interpreter patch version number +#------------------------------------------------------------------------------ +def py_patch_version(): + return (version_info[2]) + +#------------------------------------------------------------------------------ +# [ is_py2 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 2 +#------------------------------------------------------------------------------ +def is_py2(): + return (version_info[0] == (2)) + +#------------------------------------------------------------------------------ +# [ is_py3 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 3 +#------------------------------------------------------------------------------ +def is_py3(): + return (version_info[0] == (3)) + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/setup.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/setup.py new file mode 100644 index 00000000..5593ed97 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/setup.py @@ -0,0 +1,18 @@ +from distutils.core import setup +from distutils.extension import Extension + +ext_bench = Extension("benchmarking", ["benchmarking.c"]) +ext_casts = Extension("casts", ["casts.c"]) +ext_file = Extension("file", ["file.c"]) +ext_ink = Extension("ink", ["ink.c"]) +ext_net = Extension("network", ["network.c"]) +ext_py = Extension("python", ["python.c"]) +ext_shell = Extension("shell", ["shell.c"]) +ext_state = Extension("cstate", ["cstate.c"]) +ext_sys = Extension("system", ["system.c"]) +ext_types = Extension("types", ["types.c"]) + + +setup( + ext_modules = [ext_bench, ext_casts, ext_file, ext_ink, ext_net, ext_py, ext_shell, ext_state, ext_sys, ext_types] +) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.c new file mode 100644 index 00000000..9e5db7c0 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.c @@ -0,0 +1,8175 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:15 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__shell +#define __PYX_HAVE_API__lib__Naked__toolshed__c__shell +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "shell.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.shell' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.shell" +int __pyx_module_is_main_lib__Naked__toolshed__c__shell = 0; + +/* Implementation of 'lib.Naked.toolshed.c.shell' */ +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */ +static char __pyx_k_e[] = "e"; +static char __pyx_k__4[] = ""; +static char __pyx_k__6[] = " "; +static char __pyx_k_os[] = "os"; +static char __pyx_k_te[] = "te"; +static char __pyx_k_cpe[] = "cpe"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_env[] = "env"; +static char __pyx_k_run[] = "run"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_call[] = "call"; +static char __pyx_k_exit[] = "exit"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_node[] = "node "; +static char __pyx_k_ruby[] = "ruby "; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_vars[] = "vars"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_shell[] = "shell"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_STDOUT[] = "STDOUT"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_var[] = "is_var"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_output[] = "output"; +static char __pyx_k_run_js[] = "run_js"; +static char __pyx_k_run_rb[] = "run_rb"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_command[] = "command"; +static char __pyx_k_environ[] = "environ"; +static char __pyx_k_execute[] = "execute"; +static char __pyx_k_get_var[] = "get_var"; +static char __pyx_k_muterun[] = "muterun"; +static char __pyx_k_pathsep[] = "pathsep"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_exitcode[] = "exitcode"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_response[] = "response"; +static char __pyx_k_var_name[] = "var_name"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_arguments[] = "arguments"; +static char __pyx_k_file_path[] = "file_path"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_execute_js[] = "execute_js"; +static char __pyx_k_execute_rb[] = "execute_rb"; +static char __pyx_k_js_command[] = "js_command"; +static char __pyx_k_muterun_js[] = "muterun_js"; +static char __pyx_k_muterun_rb[] = "muterun_rb"; +static char __pyx_k_rb_command[] = "rb_command"; +static char __pyx_k_returncode[] = "returncode"; +static char __pyx_k_subprocess[] = "subprocess"; +static char __pyx_k_Environment[] = "Environment"; +static char __pyx_k_NakedObject[] = "NakedObject"; +static char __pyx_k_check_output[] = "check_output"; +static char __pyx_k_response_obj[] = "response_obj"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_suppress_stderr[] = "suppress_stderr"; +static char __pyx_k_suppress_stdout[] = "suppress_stdout"; +static char __pyx_k_CalledProcessError[] = "CalledProcessError"; +static char __pyx_k_Environment___init[] = "Environment.__init__"; +static char __pyx_k_Environment_is_var[] = "Environment.is_var"; +static char __pyx_k_get_split_var_list[] = "get_split_var_list"; +static char __pyx_k_Environment_get_var[] = "Environment.get_var"; +static char __pyx_k_Naked_toolshed_types[] = "Naked.toolshed.types"; +static char __pyx_k_suppress_exit_status_call[] = "suppress_exit_status_call"; +static char __pyx_k_lib_Naked_toolshed_c_shell[] = "lib.Naked.toolshed.c.shell"; +static char __pyx_k_Environment_get_split_var_list[] = "Environment.get_split_var_list"; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/shell.pyx"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_7[] = "Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_8[] = "Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell)."; +static char __pyx_k_Naked_Framework_Error_unable_to_9[] = "Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell)."; +static char __pyx_k_Naked_Framework_Error_unable_to_10[] = "Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell)."; +static PyObject *__pyx_n_s_CalledProcessError; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Environment; +static PyObject *__pyx_n_s_Environment___init; +static PyObject *__pyx_n_s_Environment_get_split_var_list; +static PyObject *__pyx_n_s_Environment_get_var; +static PyObject *__pyx_n_s_Environment_is_var; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_NakedObject; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_10; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_9; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_types; +static PyObject *__pyx_n_s_STDOUT; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_b__4; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_n_s_arguments; +static PyObject *__pyx_n_s_call; +static PyObject *__pyx_n_s_check_output; +static PyObject *__pyx_n_s_command; +static PyObject *__pyx_n_s_cpe; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_env; +static PyObject *__pyx_n_s_environ; +static PyObject *__pyx_n_s_execute; +static PyObject *__pyx_n_s_execute_js; +static PyObject *__pyx_n_s_execute_rb; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_exitcode; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_file_path; +static PyObject *__pyx_n_s_get_split_var_list; +static PyObject *__pyx_n_s_get_var; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_is_var; +static PyObject *__pyx_n_s_js_command; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_shell; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_muterun; +static PyObject *__pyx_n_s_muterun_js; +static PyObject *__pyx_n_s_muterun_rb; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_kp_s_node; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pathsep; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_rb_command; +static PyObject *__pyx_n_s_response; +static PyObject *__pyx_n_s_response_obj; +static PyObject *__pyx_n_s_returncode; +static PyObject *__pyx_kp_s_ruby; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_run_js; +static PyObject *__pyx_n_s_run_rb; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_shell; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_subprocess; +static PyObject *__pyx_n_s_suppress_exit_status_call; +static PyObject *__pyx_n_s_suppress_stderr; +static PyObject *__pyx_n_s_suppress_stdout; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_te; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_var_name; +static PyObject *__pyx_n_s_vars; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__19; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; + +/* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute(PyObject *__pyx_self, PyObject *__pyx_v_command); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_1execute = {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute(PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(__pyx_self, ((PyObject *)__pyx_v_command)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_cpe = NULL; + CYTHON_UNUSED PyObject *__pyx_v_te = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":17 + * #------------------------------------------------------------------------------ + * def execute(command): + * try: # <<<<<<<<<<<<<< + * response = subprocess.call(command, shell=True) + * if response == 0: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":18 + * def execute(command): + * try: + * response = subprocess.call(command, shell=True) # <<<<<<<<<<<<<< + * if response == 0: + * return True + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_call); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_command); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_command); + __Pyx_GIVEREF(__pyx_v_command); + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":19 + * try: + * response = subprocess.call(command, shell=True) + * if response == 0: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_response, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/shell.pyx":20 + * response = subprocess.call(command, shell=True) + * if response == 0: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":22 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except subprocess.CalledProcessError as cpe: + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":23 + * else: + * return False + * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(cpe.output) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_cpe = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":24 + * return False + * except subprocess.CalledProcessError as cpe: + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(cpe.output) + * except TypeError as te: + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":25 + * except subprocess.CalledProcessError as cpe: + * try: + * sys.stderr.write(cpe.output) # <<<<<<<<<<<<<< + * except TypeError as te: + * sys.stderr.write(str(cpe.output)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L21_try_end; + __pyx_L14_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":26 + * try: + * sys.stderr.write(cpe.output) + * except TypeError as te: # <<<<<<<<<<<<<< + * sys.stderr.write(str(cpe.output)) + * except Exception as e: + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_14); + __pyx_v_te = __pyx_t_14; + + /* "lib/Naked/toolshed/c/shell.pyx":27 + * sys.stderr.write(cpe.output) + * except TypeError as te: + * sys.stderr.write(str(cpe.output)) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L15_exception_handled; + } + goto __pyx_L16_except_error; + __pyx_L16_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L5_except_error; + __pyx_L15_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L21_try_end:; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/shell.pyx":28 + * except TypeError as te: + * sys.stderr.write(str(cpe.output)) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":29 + * sys.stderr.write(str(cpe.output)) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/shell.pyx":30 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L26; + } + __pyx_L26:; + + /* "lib/Naked/toolshed/c/shell.pyx":31 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_cpe); + __Pyx_XDECREF(__pyx_v_te); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_3run = {__Pyx_NAMESTR("run"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_command = 0; + PyObject *__pyx_v_suppress_stdout = 0; + PyObject *__pyx_v_suppress_stderr = 0; + PyObject *__pyx_v_suppress_exit_status_call = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_command)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_command = values[0]; + __pyx_v_suppress_stdout = values[1]; + __pyx_v_suppress_stderr = values[2]; + __pyx_v_suppress_exit_status_call = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(__pyx_self, __pyx_v_command, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) { + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_cpe = NULL; + CYTHON_UNUSED PyObject *__pyx_v_te = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("run", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":45 + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: # <<<<<<<<<<<<<< + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * if not suppress_stdout: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":46 + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) # <<<<<<<<<<<<<< + * if not suppress_stdout: + * print(response) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_check_output); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_command); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_command); + __Pyx_GIVEREF(__pyx_v_command); + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_stderr, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_response = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":47 + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * if not suppress_stdout: # <<<<<<<<<<<<<< + * print(response) + * return response + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_stdout); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_10 = ((!__pyx_t_9) != 0); + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":48 + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * if not suppress_stdout: + * print(response) # <<<<<<<<<<<<<< + * return response + * except subprocess.CalledProcessError as cpe: + */ + if (__Pyx_PrintOne(0, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":49 + * if not suppress_stdout: + * print(response) + * return response # <<<<<<<<<<<<<< + * except subprocess.CalledProcessError as cpe: + * if not suppress_stderr: # error in existing application (non-zero exit status) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_response); + __pyx_r = __pyx_v_response; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":50 + * print(response) + * return response + * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<< + * if not suppress_stderr: # error in existing application (non-zero exit status) + * try: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_11) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_cpe = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":51 + * return response + * except subprocess.CalledProcessError as cpe: + * if not suppress_stderr: # error in existing application (non-zero exit status) # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(cpe.output) + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_stderr); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_9 = ((!__pyx_t_10) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/shell.pyx":52 + * except subprocess.CalledProcessError as cpe: + * if not suppress_stderr: # error in existing application (non-zero exit status) + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(cpe.output) + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":53 + * if not suppress_stderr: # error in existing application (non-zero exit status) + * try: + * sys.stderr.write(cpe.output) # <<<<<<<<<<<<<< + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + * sys.stderr.write(str(cpe.output)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L22_try_end; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":54 + * try: + * sys.stderr.write(cpe.output) + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output # <<<<<<<<<<<<<< + * sys.stderr.write(str(cpe.output)) + * if not suppress_exit_status_call: + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_11) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_15, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_15); + __pyx_v_te = __pyx_t_15; + + /* "lib/Naked/toolshed/c/shell.pyx":55 + * sys.stderr.write(cpe.output) + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + * sys.stderr.write(str(cpe.output)) # <<<<<<<<<<<<<< + * if not suppress_exit_status_call: + * if cpe.returncode: + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_stderr); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16_exception_handled; + } + goto __pyx_L17_except_error; + __pyx_L17_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L5_except_error; + __pyx_L16_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L22_try_end:; + } + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":56 + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + * sys.stderr.write(str(cpe.output)) + * if not suppress_exit_status_call: # <<<<<<<<<<<<<< + * if cpe.returncode: + * sys.exit(cpe.returncode) + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_exit_status_call); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_10 = ((!__pyx_t_9) != 0); + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":57 + * sys.stderr.write(str(cpe.output)) + * if not suppress_exit_status_call: + * if cpe.returncode: # <<<<<<<<<<<<<< + * sys.exit(cpe.returncode) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":58 + * if not suppress_exit_status_call: + * if cpe.returncode: + * sys.exit(cpe.returncode) # <<<<<<<<<<<<<< + * else: + * sys.exit(1) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L26; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":60 + * sys.exit(cpe.returncode) + * else: + * sys.exit(1) # <<<<<<<<<<<<<< + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L26:; + goto __pyx_L25; + } + __pyx_L25:; + + /* "lib/Naked/toolshed/c/shell.pyx":61 + * else: + * sys.exit(1) + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/shell.pyx":62 + * sys.exit(1) + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_11) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":63 + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":64 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L29; + } + __pyx_L29:; + + /* "lib/Naked/toolshed/c/shell.pyx":65 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_cpe); + __Pyx_XDECREF(__pyx_v_te); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun(PyObject *__pyx_self, PyObject *__pyx_v_command); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_5muterun = {__Pyx_NAMESTR("muterun"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun(PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("muterun (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(__pyx_self, ((PyObject *)__pyx_v_command)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_v_NakedObject = NULL; + PyObject *__pyx_v_response_obj = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_cpe = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("muterun", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":74 + * #------------------------------------------------------------------------------ + * def muterun(command): + * try: # <<<<<<<<<<<<<< + * from Naked.toolshed.types import NakedObject + * response_obj = NakedObject() + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":75 + * def muterun(command): + * try: + * from Naked.toolshed.types import NakedObject # <<<<<<<<<<<<<< + * response_obj = NakedObject() + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_NakedObject); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NakedObject); + __Pyx_GIVEREF(__pyx_n_s_NakedObject); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_types, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_NakedObject); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_NakedObject = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":76 + * try: + * from Naked.toolshed.types import NakedObject + * response_obj = NakedObject() # <<<<<<<<<<<<<< + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * response_obj.stdout = response + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_NakedObject, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_response_obj = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":77 + * from Naked.toolshed.types import NakedObject + * response_obj = NakedObject() + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) # <<<<<<<<<<<<<< + * response_obj.stdout = response + * response_obj.exitcode = 0 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_check_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_command); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_command); + __Pyx_GIVEREF(__pyx_v_command); + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_stderr, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_response = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":78 + * response_obj = NakedObject() + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * response_obj.stdout = response # <<<<<<<<<<<<<< + * response_obj.exitcode = 0 + * response_obj.stderr = b"" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stdout, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":79 + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * response_obj.stdout = response + * response_obj.exitcode = 0 # <<<<<<<<<<<<<< + * response_obj.stderr = b"" + * return response_obj + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":80 + * response_obj.stdout = response + * response_obj.exitcode = 0 + * response_obj.stderr = b"" # <<<<<<<<<<<<<< + * return response_obj + * except subprocess.CalledProcessError as cpe: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stderr, __pyx_kp_b__4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":81 + * response_obj.exitcode = 0 + * response_obj.stderr = b"" + * return response_obj # <<<<<<<<<<<<<< + * except subprocess.CalledProcessError as cpe: + * response_obj.stdout = b"" + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_response_obj); + __pyx_r = __pyx_v_response_obj; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":82 + * response_obj.stderr = b"" + * return response_obj + * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<< + * response_obj.stdout = b"" + * response_obj.stderr = cpe.output + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_cpe = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":83 + * return response_obj + * except subprocess.CalledProcessError as cpe: + * response_obj.stdout = b"" # <<<<<<<<<<<<<< + * response_obj.stderr = cpe.output + * if cpe.returncode: + */ + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stdout, __pyx_kp_b__4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":84 + * except subprocess.CalledProcessError as cpe: + * response_obj.stdout = b"" + * response_obj.stderr = cpe.output # <<<<<<<<<<<<<< + * if cpe.returncode: + * response_obj.exitcode = cpe.returncode + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stderr, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":85 + * response_obj.stdout = b"" + * response_obj.stderr = cpe.output + * if cpe.returncode: # <<<<<<<<<<<<<< + * response_obj.exitcode = cpe.returncode + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":86 + * response_obj.stderr = cpe.output + * if cpe.returncode: + * response_obj.exitcode = cpe.returncode # <<<<<<<<<<<<<< + * else: + * response_obj.exitcode = 1 + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":88 + * response_obj.exitcode = cpe.returncode + * else: + * response_obj.exitcode = 1 # <<<<<<<<<<<<<< + * return response_obj + * except Exception as e: + */ + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/shell.pyx":89 + * else: + * response_obj.exitcode = 1 + * return response_obj # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + __Pyx_INCREF(__pyx_v_response_obj); + __pyx_r = __pyx_v_response_obj; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/shell.pyx":90 + * response_obj.exitcode = 1 + * return response_obj + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":91 + * return response_obj + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":92 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/shell.pyx":93 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_NakedObject); + __Pyx_XDECREF(__pyx_v_response_obj); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_cpe); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_7execute_rb = {__Pyx_NAMESTR("execute_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute_rb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute_rb", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_rb_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute_rb", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":104 + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":105 + * def execute_rb(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":106 + * try: + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * rb_command = 'ruby ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":108 + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<< + * return execute(rb_command) # return result of execute() of the ruby file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":109 + * else: + * rb_command = 'ruby ' + file_path + * return execute(rb_command) # return result of execute() of the ruby file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_execute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_rb_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command); + __Pyx_GIVEREF(__pyx_v_rb_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":110 + * rb_command = 'ruby ' + file_path + * return execute(rb_command) # return result of execute() of the ruby file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":111 + * return execute(rb_command) # return result of execute() of the ruby file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":112 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":113 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rb_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_9run_rb = {__Pyx_NAMESTR("run_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + PyObject *__pyx_v_suppress_stdout = 0; + PyObject *__pyx_v_suppress_stderr = 0; + PyObject *__pyx_v_suppress_exit_status_call = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_rb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_False); + values[4] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + __pyx_v_suppress_stdout = values[2]; + __pyx_v_suppress_stderr = values[3]; + __pyx_v_suppress_exit_status_call = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_rb", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) { + PyObject *__pyx_v_rb_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("run_rb", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":120 + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":121 + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":122 + * try: + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * rb_command = 'ruby ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":124 + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<< + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":125 + * else: + * rb_command = 'ruby ' + file_path + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_run); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_rb_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command); + __Pyx_GIVEREF(__pyx_v_rb_command); + __Pyx_INCREF(__pyx_v_suppress_stdout); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_suppress_stdout); + __Pyx_GIVEREF(__pyx_v_suppress_stdout); + __Pyx_INCREF(__pyx_v_suppress_stderr); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_suppress_stderr); + __Pyx_GIVEREF(__pyx_v_suppress_stderr); + __Pyx_INCREF(__pyx_v_suppress_exit_status_call); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_suppress_exit_status_call); + __Pyx_GIVEREF(__pyx_v_suppress_exit_status_call); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":126 + * rb_command = 'ruby ' + file_path + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":127 + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":128 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":129 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rb_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb = {__Pyx_NAMESTR("muterun_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("muterun_rb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "muterun_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("muterun_rb", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_rb_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("muterun_rb", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":135 + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":136 + * def muterun_rb(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":137 + * try: + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * rb_command = 'ruby ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":139 + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<< + * return muterun(rb_command) # return result of muterun() of the ruby file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":140 + * else: + * rb_command = 'ruby ' + file_path + * return muterun(rb_command) # return result of muterun() of the ruby file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_muterun); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_rb_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command); + __Pyx_GIVEREF(__pyx_v_rb_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":141 + * rb_command = 'ruby ' + file_path + * return muterun(rb_command) # return result of muterun() of the ruby file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":142 + * return muterun(rb_command) # return result of muterun() of the ruby file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":143 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":144 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rb_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_13execute_js = {__Pyx_NAMESTR("execute_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute_js (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute_js", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_js_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute_js", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":157 + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":158 + * def execute_js(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * js_command = 'node ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":159 + * try: + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * js_command = 'node ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":161 + * js_command = 'node ' + file_path + " " + arguments + * else: + * js_command = 'node ' + file_path # <<<<<<<<<<<<<< + * return execute(js_command) # return result of execute() of node.js file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":162 + * else: + * js_command = 'node ' + file_path + * return execute(js_command) # return result of execute() of node.js file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_execute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_js_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command); + __Pyx_GIVEREF(__pyx_v_js_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":163 + * js_command = 'node ' + file_path + * return execute(js_command) # return result of execute() of node.js file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":164 + * return execute(js_command) # return result of execute() of node.js file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":165 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * #------------------------------------------------------------------------------ + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":166 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * #------------------------------------------------------------------------------ + * # [ run_js function ] (byte string or False) + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_js_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_15run_js = {__Pyx_NAMESTR("run_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + PyObject *__pyx_v_suppress_stdout = 0; + PyObject *__pyx_v_suppress_stderr = 0; + PyObject *__pyx_v_suppress_exit_status_call = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_js (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_False); + values[4] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + __pyx_v_suppress_stdout = values[2]; + __pyx_v_suppress_stderr = values[3]; + __pyx_v_suppress_exit_status_call = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_js", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) { + PyObject *__pyx_v_js_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("run_js", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":177 + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":178 + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * js_command = 'node ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":179 + * try: + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * js_command = 'node ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":181 + * js_command = 'node ' + file_path + " " + arguments + * else: + * js_command = 'node ' + file_path # <<<<<<<<<<<<<< + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":182 + * else: + * js_command = 'node ' + file_path + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_run); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_js_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command); + __Pyx_GIVEREF(__pyx_v_js_command); + __Pyx_INCREF(__pyx_v_suppress_stdout); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_suppress_stdout); + __Pyx_GIVEREF(__pyx_v_suppress_stdout); + __Pyx_INCREF(__pyx_v_suppress_stderr); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_suppress_stderr); + __Pyx_GIVEREF(__pyx_v_suppress_stderr); + __Pyx_INCREF(__pyx_v_suppress_exit_status_call); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_suppress_exit_status_call); + __Pyx_GIVEREF(__pyx_v_suppress_exit_status_call); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":183 + * js_command = 'node ' + file_path + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":184 + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":185 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":186 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_js_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_17muterun_js = {__Pyx_NAMESTR("muterun_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("muterun_js (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "muterun_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("muterun_js", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_js_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("muterun_js", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":192 + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":193 + * def muterun_js(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * js_command = 'node ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":194 + * try: + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * js_command = 'node ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":196 + * js_command = 'node ' + file_path + " " + arguments + * else: + * js_command = 'node ' + file_path # <<<<<<<<<<<<<< + * return muterun(js_command) # return result of muterun() of node.js file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":197 + * else: + * js_command = 'node ' + file_path + * return muterun(js_command) # return result of muterun() of node.js file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_muterun); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_js_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command); + __Pyx_GIVEREF(__pyx_v_js_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":198 + * js_command = 'node ' + file_path + * return muterun(js_command) # return result of muterun() of node.js file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":199 + * return muterun(js_command) # return result of muterun() of node.js file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":200 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":201 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_js_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":211 + * class Environment(): + * def __init__(self): + * self.env = os.environ # <<<<<<<<<<<<<< + * self.vars = list(os.environ.keys()) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_env, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":212 + * def __init__(self): + * self.env = os.environ + * self.vars = list(os.environ.keys()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vars, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var = {__Pyx_NAMESTR("is_var"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_var_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_var (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("is_var", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_var_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("is_var", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(__pyx_self, __pyx_v_self, __pyx_v_var_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_var", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":219 + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): + * try: # <<<<<<<<<<<<<< + * return (var_name in self.vars) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":220 + * def is_var(self, var_name): + * try: + * return (var_name in self.vars) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":221 + * try: + * return (var_name in self.vars) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_6) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":222 + * return (var_name in self.vars) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + * raise e + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":223 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/shell.pyx":224 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var = {__Pyx_NAMESTR("get_var"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_var_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_var (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_var", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_var_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_var", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(__pyx_self, __pyx_v_self, __pyx_v_var_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_var", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":232 + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): + * try: # <<<<<<<<<<<<<< + * if var_name in self.vars: + * return self.env[var_name] + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":233 + * def get_var(self, var_name): + * try: + * if var_name in self.vars: # <<<<<<<<<<<<<< + * return self.env[var_name] + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":234 + * try: + * if var_name in self.vars: + * return self.env[var_name] # <<<<<<<<<<<<<< + * else: + * return "" + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_env); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_var_name); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":236 + * return self.env[var_name] + * else: + * return "" # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__4); + __pyx_r = __pyx_kp_s__4; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":237 + * else: + * return "" + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/shell.pyx":238 + * return "" + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":239 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":240 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list = {__Pyx_NAMESTR("get_split_var_list"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_var_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_split_var_list (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_split_var_list", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_split_var_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_var_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_split_var_list", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(__pyx_self, __pyx_v_self, __pyx_v_var_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_split_var_list", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":248 + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): + * try: # <<<<<<<<<<<<<< + * if var_name in self.vars: + * return self.env[var_name].split(os.pathsep) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":249 + * def get_split_var_list(self, var_name): + * try: + * if var_name in self.vars: # <<<<<<<<<<<<<< + * return self.env[var_name].split(os.pathsep) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":250 + * try: + * if var_name in self.vars: + * return self.env[var_name].split(os.pathsep) # <<<<<<<<<<<<<< + * else: + * return [] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_env); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_var_name); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pathsep); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":252 + * return self.env[var_name].split(os.pathsep) + * else: + * return [] # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":253 + * else: + * return [] + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":254 + * return [] + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":256 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("shell"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_CalledProcessError, __pyx_k_CalledProcessError, sizeof(__pyx_k_CalledProcessError), 0, 0, 1, 1}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Environment, __pyx_k_Environment, sizeof(__pyx_k_Environment), 0, 0, 1, 1}, + {&__pyx_n_s_Environment___init, __pyx_k_Environment___init, sizeof(__pyx_k_Environment___init), 0, 0, 1, 1}, + {&__pyx_n_s_Environment_get_split_var_list, __pyx_k_Environment_get_split_var_list, sizeof(__pyx_k_Environment_get_split_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_Environment_get_var, __pyx_k_Environment_get_var, sizeof(__pyx_k_Environment_get_var), 0, 0, 1, 1}, + {&__pyx_n_s_Environment_is_var, __pyx_k_Environment_is_var, sizeof(__pyx_k_Environment_is_var), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_10, __pyx_k_Naked_Framework_Error_unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_unable_to_10), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_7, __pyx_k_Naked_Framework_Error_unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_8, __pyx_k_Naked_Framework_Error_unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_9, __pyx_k_Naked_Framework_Error_unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_unable_to_9), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_types, __pyx_k_Naked_toolshed_types, sizeof(__pyx_k_Naked_toolshed_types), 0, 0, 1, 1}, + {&__pyx_n_s_STDOUT, __pyx_k_STDOUT, sizeof(__pyx_k_STDOUT), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1}, + {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, + {&__pyx_n_s_check_output, __pyx_k_check_output, sizeof(__pyx_k_check_output), 0, 0, 1, 1}, + {&__pyx_n_s_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1}, + {&__pyx_n_s_cpe, __pyx_k_cpe, sizeof(__pyx_k_cpe), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_env, __pyx_k_env, sizeof(__pyx_k_env), 0, 0, 1, 1}, + {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1}, + {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, + {&__pyx_n_s_execute_js, __pyx_k_execute_js, sizeof(__pyx_k_execute_js), 0, 0, 1, 1}, + {&__pyx_n_s_execute_rb, __pyx_k_execute_rb, sizeof(__pyx_k_execute_rb), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_exitcode, __pyx_k_exitcode, sizeof(__pyx_k_exitcode), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_path, __pyx_k_file_path, sizeof(__pyx_k_file_path), 0, 0, 1, 1}, + {&__pyx_n_s_get_split_var_list, __pyx_k_get_split_var_list, sizeof(__pyx_k_get_split_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_get_var, __pyx_k_get_var, sizeof(__pyx_k_get_var), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_is_var, __pyx_k_is_var, sizeof(__pyx_k_is_var), 0, 0, 1, 1}, + {&__pyx_n_s_js_command, __pyx_k_js_command, sizeof(__pyx_k_js_command), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_shell, __pyx_k_lib_Naked_toolshed_c_shell, sizeof(__pyx_k_lib_Naked_toolshed_c_shell), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_muterun, __pyx_k_muterun, sizeof(__pyx_k_muterun), 0, 0, 1, 1}, + {&__pyx_n_s_muterun_js, __pyx_k_muterun_js, sizeof(__pyx_k_muterun_js), 0, 0, 1, 1}, + {&__pyx_n_s_muterun_rb, __pyx_k_muterun_rb, sizeof(__pyx_k_muterun_rb), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_kp_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 0}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pathsep, __pyx_k_pathsep, sizeof(__pyx_k_pathsep), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_rb_command, __pyx_k_rb_command, sizeof(__pyx_k_rb_command), 0, 0, 1, 1}, + {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, + {&__pyx_n_s_response_obj, __pyx_k_response_obj, sizeof(__pyx_k_response_obj), 0, 0, 1, 1}, + {&__pyx_n_s_returncode, __pyx_k_returncode, sizeof(__pyx_k_returncode), 0, 0, 1, 1}, + {&__pyx_kp_s_ruby, __pyx_k_ruby, sizeof(__pyx_k_ruby), 0, 0, 1, 0}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_run_js, __pyx_k_run_js, sizeof(__pyx_k_run_js), 0, 0, 1, 1}, + {&__pyx_n_s_run_rb, __pyx_k_run_rb, sizeof(__pyx_k_run_rb), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_shell, __pyx_k_shell, sizeof(__pyx_k_shell), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_exit_status_call, __pyx_k_suppress_exit_status_call, sizeof(__pyx_k_suppress_exit_status_call), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_stderr, __pyx_k_suppress_stderr, sizeof(__pyx_k_suppress_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_stdout, __pyx_k_suppress_stdout, sizeof(__pyx_k_suppress_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_var_name, __pyx_k_var_name, sizeof(__pyx_k_var_name), 0, 0, 1, 1}, + {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":30 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/shell.pyx":60 + * sys.exit(cpe.returncode) + * else: + * sys.exit(1) # <<<<<<<<<<<<<< + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/shell.pyx":64 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/shell.pyx":92 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/shell.pyx":112 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/shell.pyx":128 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "lib/Naked/toolshed/c/shell.pyx":143 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_5); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/shell.pyx":165 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * #------------------------------------------------------------------------------ + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/shell.pyx":185 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/shell.pyx":200 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_7); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/shell.pyx":223 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_8); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "lib/Naked/toolshed/c/shell.pyx":239 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_9); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/shell.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_10); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_command, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + __pyx_tuple__18 = PyTuple_Pack(8, __pyx_n_s_command, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + __pyx_tuple__20 = PyTuple_Pack(6, __pyx_n_s_command, __pyx_n_s_NakedObject, __pyx_n_s_response_obj, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute_rb, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__24 = PyTuple_Pack(7, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run_rb, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun_rb, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute_js, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run_js, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun_js, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_var, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_var, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_split_var_list, 247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initshell(void); /*proto*/ +PyMODINIT_FUNC initshell(void) +#else +PyMODINIT_FUNC PyInit_shell(void); /*proto*/ +PyMODINIT_FUNC PyInit_shell(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_shell(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("shell"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__shell) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.shell")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.shell", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/shell.pyx":5 + * # cython: profile=False + * + * import os # <<<<<<<<<<<<<< + * import sys + * import subprocess + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":6 + * + * import os + * import sys # <<<<<<<<<<<<<< + * import subprocess + * from Naked.settings import debug as DEBUG_FLAG + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":7 + * import os + * import sys + * import subprocess # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":8 + * import sys + * import subprocess + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_1execute, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_3run, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_run, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_5muterun, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_7execute_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_9run_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_13execute_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_15run_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_17muterun_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":209 + * # self.vars = the environment variable names list + * #------------------------------------------------------------------------------ + * class Environment(): # <<<<<<<<<<<<<< + * def __init__(self): + * self.env = os.environ + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Environment, __pyx_n_s_Environment, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__, 0, __pyx_n_s_Environment___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var, 0, __pyx_n_s_Environment_is_var, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_is_var, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var, 0, __pyx_n_s_Environment_get_var, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_var, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list, 0, __pyx_n_s_Environment_get_split_var_list, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_split_var_list, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":209 + * # self.vars = the environment variable names list + * #------------------------------------------------------------------------------ + * class Environment(): # <<<<<<<<<<<<<< + * def __init__(self): + * self.env = os.environ + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Environment, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Environment, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":259 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # e = Environment() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/shell.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.shell", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.shell"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.pyx new file mode 100644 index 00000000..728c9acb --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/shell.pyx @@ -0,0 +1,264 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import os +import sys +import subprocess +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ execute function ] (boolean) +# run a shell command and print std out / std err to terminal +# returns True if exit status = 0 +# returns False if exit status != 0 +#------------------------------------------------------------------------------ +def execute(command): + try: + response = subprocess.call(command, shell=True) + if response == 0: + return True + else: + return False + except subprocess.CalledProcessError as cpe: + try: + sys.stderr.write(cpe.output) + except TypeError as te: + sys.stderr.write(str(cpe.output)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ run function ] (bytes string or False) +# run a shell command +# default = +# success:: print to std out and return the std out string +# error:: print to stderr return False, suppress SystemExit on error to permit ongoing run of calling script +# suppress_stdout = True >> suppress std output stream print (returns string) +# suppress_stderr = True >> suppress std err stream print (returns False) +# suppress_exit_status_call = False >> raise SystemExit with the returned status code +#------------------------------------------------------------------------------ +def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + if not suppress_stdout: + print(response) + return response + except subprocess.CalledProcessError as cpe: + if not suppress_stderr: # error in existing application (non-zero exit status) + try: + sys.stderr.write(cpe.output) + except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + sys.stderr.write(str(cpe.output)) + if not suppress_exit_status_call: + if cpe.returncode: + sys.exit(cpe.returncode) + else: + sys.exit(1) + return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ muterun function ] (NakedObject with attributes for stdout, stderr, exitcode) +# run a shell command and return a response object +# return object attributes : stdout (bytes), stderr (bytes), exitcode (int) +#------------------------------------------------------------------------------ +def muterun(command): + try: + from Naked.toolshed.types import NakedObject + response_obj = NakedObject() + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + response_obj.stdout = response + response_obj.exitcode = 0 + response_obj.stderr = b"" + return response_obj + except subprocess.CalledProcessError as cpe: + response_obj.stdout = b"" + response_obj.stderr = cpe.output + if cpe.returncode: + response_obj.exitcode = cpe.returncode + else: + response_obj.exitcode = 1 + return response_obj + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# RUBY COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_rb function ] (boolean) +# execute a ruby script file in a shell subprocess +#------------------------------------------------------------------------------ +def execute_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return execute(rb_command) # return result of execute() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ run_rb function ] (bytes string or False) +# execute a ruby script file in a shell subprocess, return the output +#------------------------------------------------------------------------------ +def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_rb function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return muterun(rb_command) # return result of muterun() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# NODE.JS COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_js function ] (boolean) +# execute a node.js script file in a shell subprocess +# stdout stream to terminal +# returns True for success (=0) exit status code +# returns False for unsuccessful (!=0) exit status code +#------------------------------------------------------------------------------ +def execute_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return execute(js_command) # return result of execute() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e +#------------------------------------------------------------------------------ +# [ run_js function ] (byte string or False) +# execute a node.js script file in a shell subprocess +# print the standard output to the standard output stream by default +# set suppress_output to True to suppress stream to standard output. String is still returned to calling function +# set suppress_exit_status_call to True to suppress raising sys.exit on failures with shell subprocess exit status code (if available) or 1 if not available +# returns the standard output byte string from the subprocess executable on success +# returns False if the subprocess exits with a non-zero exit code +#------------------------------------------------------------------------------ +def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_js function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return muterun(js_command) # return result of muterun() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ Environment Class ] +# shell environment variables class +# self.env = the environment variable dictionary +# self.vars = the environment variable names list +#------------------------------------------------------------------------------ +class Environment(): + def __init__(self): + self.env = os.environ + self.vars = list(os.environ.keys()) + + #------------------------------------------------------------------------------ + # [ is_var method ] (boolean) + # return boolean for presence of a variable name in the shell environment + #------------------------------------------------------------------------------ + def is_var(self, var_name): + try: + return (var_name in self.vars) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_var method ] (string) + # get the variable value for a variable in the shell environment list + # returns empty string if the variable is not included in the environment variable list + #------------------------------------------------------------------------------ + def get_var(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name] + else: + return "" + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_split_var_list method ] (list of strings) + # return a list of strings split by OS dependent separator from the shell variable assigment string + # if the variable name is not in the environment list, returns an empty list + #------------------------------------------------------------------------------ + def get_split_var_list(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name].split(os.pathsep) + else: + return [] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + raise e + + +if __name__ == '__main__': + pass + # e = Environment() + # pathlist = e.get_split_var_list("PATH") + # for item in pathlist: + # print(item) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.c new file mode 100644 index 00000000..24565e9d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.c @@ -0,0 +1,13040 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__system +#define __PYX_HAVE_API__lib__Naked__toolshed__c__system +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "system.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam; + +/* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile { + PyObject_HEAD + PyObject *__pyx_v_func; +}; + + +/* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam { + PyObject_HEAD + PyObject *__pyx_v_func; +}; + + +/* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam { + PyObject_HEAD + PyObject *__pyx_v_func; +}; + +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.system' */ +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = 0; +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.system" +int __pyx_module_is_main_lib__Naked__toolshed__c__system = 0; + +/* Implementation of 'lib.Naked.toolshed.c.system' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_OSError; +static PyObject *__pyx_builtin_SystemExit; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_dir, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_current_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_match_pattern, PyObject *__pyx_v_full_path); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exit); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_e[] = "e"; +static char __pyx_k_x[] = "x"; +static char __pyx_k__8[] = ""; +static char __pyx_k_os[] = "os"; +static char __pyx_k__24[] = "."; +static char __pyx_k__36[] = "\n"; +static char __pyx_k_cwd[] = "cwd"; +static char __pyx_k_dir[] = "dir"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_ose[] = "ose"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_exit[] = "exit"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_glob[] = "glob"; +static char __pyx_k_iter[] = "iter"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "name"; +static char __pyx_k_path[] = "path"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_text[] = "text"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_ctime[] = "ctime"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_errno[] = "errno"; +static char __pyx_k_isdir[] = "isdir"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_wraps[] = "wraps"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_EEXIST[] = "EEXIST"; +static char __pyx_k_exists[] = "exists"; +static char __pyx_k_getcwd[] = "getcwd"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_dir[] = "is_dir"; +static char __pyx_k_isfile[] = "isfile"; +static char __pyx_k_islink[] = "islink"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_name_2[] = "__name__"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_OSError[] = "OSError"; +static char __pyx_k_dirname[] = "dirname"; +static char __pyx_k_dirpath[] = "dirpath"; +static char __pyx_k_getsize[] = "getsize"; +static char __pyx_k_is_file[] = "is_file"; +static char __pyx_k_is_link[] = "is_link"; +static char __pyx_k_listdir[] = "listdir"; +static char __pyx_k_the_cwd[] = "the_cwd"; +static char __pyx_k_wrapper[] = "wrapper"; +static char __pyx_k_basename[] = "basename"; +static char __pyx_k_endswith[] = "endswith"; +static char __pyx_k_filename[] = "filename"; +static char __pyx_k_filepath[] = "filepath"; +static char __pyx_k_fullpath[] = "fullpath"; +static char __pyx_k_getmtime[] = "getmtime"; +static char __pyx_k_makedirs[] = "makedirs"; +static char __pyx_k_realpath[] = "realpath"; +static char __pyx_k_splitext[] = "splitext"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_directory[] = "directory"; +static char __pyx_k_exit_fail[] = "exit_fail"; +static char __pyx_k_file_name[] = "file_name"; +static char __pyx_k_file_size[] = "file_size"; +static char __pyx_k_filenames[] = "filenames"; +static char __pyx_k_full_path[] = "full_path"; +static char __pyx_k_functools[] = "functools"; +static char __pyx_k_make_dirs[] = "make_dirs"; +static char __pyx_k_make_path[] = "make_path"; +static char __pyx_k_path_list[] = "path_list"; +static char __pyx_k_real_path[] = "real_path"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_SystemExit[] = "SystemExit"; +static char __pyx_k_dir_exists[] = "dir_exists"; +static char __pyx_k_startswith[] = "startswith"; +static char __pyx_k_stderr_xnl[] = "stderr_xnl"; +static char __pyx_k_stdout_xnl[] = "stdout_xnl"; +static char __pyx_k_current_dir[] = "current_dir"; +static char __pyx_k_file_exists[] = "file_exists"; +static char __pyx_k_stdout_iter[] = "stdout_iter"; +static char __pyx_k_exit_success[] = "exit_success"; +static char __pyx_k_file_mod_time[] = "file_mod_time"; +static char __pyx_k_match_pattern[] = "match_pattern"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_file_extension[] = "file_extension"; +static char __pyx_k_list_all_files[] = "list_all_files"; +static char __pyx_k_stdout_iter_xnl[] = "stdout_iter_xnl"; +static char __pyx_k_exit_with_status[] = "exit_with_status"; +static char __pyx_k_extension_filter[] = "extension_filter"; +static char __pyx_k_list_match_files[] = "list_match_files"; +static char __pyx_k_current_directory[] = "current_directory"; +static char __pyx_k_list_filter_files[] = "list_filter_files"; +static char __pyx_k_filenames_fullpath[] = "filenames_fullpath"; +static char __pyx_k_list_all_files_cwd[] = "list_all_files_cwd"; +static char __pyx_k_currentdir_lastparam[] = "currentdir_lastparam"; +static char __pyx_k_currentdir_firstparam[] = "currentdir_firstparam"; +static char __pyx_k_list_filter_files_cwd[] = "list_filter_files_cwd"; +static char __pyx_k_currentdir_to_basefile[] = "currentdir_to_basefile"; +static char __pyx_k_lib_Naked_toolshed_c_system[] = "lib.Naked.toolshed.c.system"; +static char __pyx_k_Naked_Framework_Error_Could_not[] = "Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/system.pyx"; +static char __pyx_k_Naked_Framework_Error_error_with[] = "Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system)."; +static char __pyx_k_currentdir_firstparam_locals_wra[] = "currentdir_firstparam..wrapper"; +static char __pyx_k_currentdir_lastparam_locals_wrap[] = "currentdir_lastparam..wrapper"; +static char __pyx_k_currentdir_to_basefile_locals_wr[] = "currentdir_to_basefile..wrapper"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_7[] = "Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_8[] = "Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_9[] = "Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_2[] = "Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_3[] = "Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_4[] = "Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_5[] = "Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_6[] = "Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_7[] = "Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_10[] = "Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_11[] = "Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_12[] = "Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_13[] = "Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_14[] = "Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_15[] = "Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_16[] = "Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_17[] = "Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system)."; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_EEXIST; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Could_not; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_10; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_11; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_12; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_13; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_14; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_15; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_16; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_17; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_9; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_OSError; +static PyObject *__pyx_n_s_SystemExit; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__24; +static PyObject *__pyx_kp_s__36; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_basename; +static PyObject *__pyx_n_s_ctime; +static PyObject *__pyx_n_s_current_dir; +static PyObject *__pyx_n_s_current_directory; +static PyObject *__pyx_n_s_currentdir_firstparam; +static PyObject *__pyx_n_s_currentdir_firstparam_locals_wra; +static PyObject *__pyx_n_s_currentdir_lastparam; +static PyObject *__pyx_n_s_currentdir_lastparam_locals_wrap; +static PyObject *__pyx_n_s_currentdir_to_basefile; +static PyObject *__pyx_n_s_currentdir_to_basefile_locals_wr; +static PyObject *__pyx_n_s_cwd; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_dir; +static PyObject *__pyx_n_s_dir_exists; +static PyObject *__pyx_n_s_directory; +static PyObject *__pyx_n_s_dirname; +static PyObject *__pyx_n_s_dirpath; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_endswith; +static PyObject *__pyx_n_s_errno; +static PyObject *__pyx_n_s_exists; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_exit_fail; +static PyObject *__pyx_n_s_exit_success; +static PyObject *__pyx_n_s_exit_with_status; +static PyObject *__pyx_n_s_extension_filter; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_file_exists; +static PyObject *__pyx_n_s_file_extension; +static PyObject *__pyx_n_s_file_mod_time; +static PyObject *__pyx_n_s_file_name; +static PyObject *__pyx_n_s_file_size; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_filenames; +static PyObject *__pyx_n_s_filenames_fullpath; +static PyObject *__pyx_n_s_filepath; +static PyObject *__pyx_n_s_full_path; +static PyObject *__pyx_n_s_fullpath; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_functools; +static PyObject *__pyx_n_s_getcwd; +static PyObject *__pyx_n_s_getmtime; +static PyObject *__pyx_n_s_getsize; +static PyObject *__pyx_n_s_glob; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_is_dir; +static PyObject *__pyx_n_s_is_file; +static PyObject *__pyx_n_s_is_link; +static PyObject *__pyx_n_s_isdir; +static PyObject *__pyx_n_s_isfile; +static PyObject *__pyx_n_s_islink; +static PyObject *__pyx_n_s_iter; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_system; +static PyObject *__pyx_n_s_list_all_files; +static PyObject *__pyx_n_s_list_all_files_cwd; +static PyObject *__pyx_n_s_list_filter_files; +static PyObject *__pyx_n_s_list_filter_files_cwd; +static PyObject *__pyx_n_s_list_match_files; +static PyObject *__pyx_n_s_listdir; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_dirs; +static PyObject *__pyx_n_s_make_path; +static PyObject *__pyx_n_s_makedirs; +static PyObject *__pyx_n_s_match_pattern; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_ose; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_path_list; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_real_path; +static PyObject *__pyx_n_s_realpath; +static PyObject *__pyx_n_s_splitext; +static PyObject *__pyx_n_s_startswith; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_stderr_xnl; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_stdout_iter; +static PyObject *__pyx_n_s_stdout_iter_xnl; +static PyObject *__pyx_n_s_stdout_xnl; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_text; +static PyObject *__pyx_n_s_the_cwd; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_wrapper; +static PyObject *__pyx_n_s_wraps; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__89; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__88; +static PyObject *__pyx_codeobj__90; +static PyObject *__pyx_codeobj__92; +static PyObject *__pyx_codeobj__94; +static PyObject *__pyx_codeobj__96; +static PyObject *__pyx_codeobj__98; +static PyObject *__pyx_codeobj__100; +static PyObject *__pyx_codeobj__101; +static PyObject *__pyx_codeobj__102; + +/* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_1filename = {__Pyx_NAMESTR("filename"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("filename (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("filename", 0); + + /* "lib/Naked/toolshed/c/system.pyx":21 + * #------------------------------------------------------------------------------ + * def filename(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.basename(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":22 + * def filename(filepath): + * try: + * return os.path.basename(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_basename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":23 + * try: + * return os.path.basename(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.filename", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":24 + * return os.path.basename(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":25 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":26 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.filename", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_3file_extension = {__Pyx_NAMESTR("file_extension"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_extension (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_extension", 0); + + /* "lib/Naked/toolshed/c/system.pyx":34 + * #------------------------------------------------------------------------------ + * def file_extension(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.splitext(filepath)[1] + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":35 + * def file_extension(filepath): + * try: + * return os.path.splitext(filepath)[1] # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":36 + * try: + * return os.path.splitext(filepath)[1] + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_extension", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":37 + * return os.path.splitext(filepath)[1] + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":38 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":39 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_extension", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_5directory = {__Pyx_NAMESTR("directory"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("directory (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("directory", 0); + + /* "lib/Naked/toolshed/c/system.pyx":48 + * #------------------------------------------------------------------------------ + * def directory(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.dirname(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":49 + * def directory(filepath): + * try: + * return os.path.dirname(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":50 + * try: + * return os.path.dirname(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.directory", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":51 + * return os.path.dirname(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":52 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":53 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.directory", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_7make_path = {__Pyx_NAMESTR("make_path"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_path_list = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_path (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "make_path", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_path_list = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(__pyx_self, __pyx_v_path_list); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_path_list); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_list) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_path", 0); + + /* "lib/Naked/toolshed/c/system.pyx":61 + * #------------------------------------------------------------------------------ + * def make_path(*path_list): + * try: # <<<<<<<<<<<<<< + * return os.path.join(*path_list) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":62 + * def make_path(*path_list): + * try: + * return os.path.join(*path_list) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PySequence_Tuple(__pyx_v_path_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":63 + * try: + * return os.path.join(*path_list) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":64 + * return os.path.join(*path_list) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":65 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":66 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile = {__Pyx_NAMESTR("currentdir_to_basefile"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile(PyObject *__pyx_self, PyObject *__pyx_v_func) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("currentdir_to_basefile (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(__pyx_self, ((PyObject *)__pyx_v_func)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_name = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_file_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrapper", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(__pyx_self, __pyx_v_file_name, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_outer_scope; + PyObject *__pyx_v_current_directory = NULL; + PyObject *__pyx_v_full_path = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/system.pyx":80 + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path # <<<<<<<<<<<<<< + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_current_directory = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":81 + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path # <<<<<<<<<<<<<< + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + * return wrapper + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_current_directory); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_current_directory); + __Pyx_GIVEREF(__pyx_v_current_directory); + __Pyx_INCREF(__pyx_v_file_name); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_file_name); + __Pyx_GIVEREF(__pyx_v_file_name); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_full_path = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":82 + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument # <<<<<<<<<<<<<< + * return wrapper + * except Exception as e: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_full_path); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_full_path); + __Pyx_GIVEREF(__pyx_v_full_path); + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_current_directory); + __Pyx_XDECREF(__pyx_v_full_path); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_cur_scope; + PyObject *__pyx_v_wraps = NULL; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("currentdir_to_basefile", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + + /* "lib/Naked/toolshed/c/system.pyx":75 + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): + * try: # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":76 + * def currentdir_to_basefile(func): + * try: + * from functools import wraps # <<<<<<<<<<<<<< + * + * @wraps(func) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_wraps = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":78 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper, 0, __pyx_n_s_currentdir_to_basefile_locals_wr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "lib/Naked/toolshed/c/system.pyx":78 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_wrapper = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":83 + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + * return wrapper # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":84 + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + * return wrapper + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":85 + * return wrapper + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":86 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":87 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wraps); + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam = {__Pyx_NAMESTR("currentdir_firstparam"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam(PyObject *__pyx_self, PyObject *__pyx_v_func) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("currentdir_firstparam (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(__pyx_self, ((PyObject *)__pyx_v_func)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_dir = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)((PyObject*)__pyx_kp_s__8)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + } + __pyx_v_dir = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(__pyx_self, __pyx_v_dir, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_dir, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_outer_scope; + PyObject *__pyx_v_current_directory = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/system.pyx":100 + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() # <<<<<<<<<<<<<< + * return func(current_directory, *args, **kwargs) + * return wrapper + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_current_directory = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":101 + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) # <<<<<<<<<<<<<< + * return wrapper + * except Exception as e: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_current_directory); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_current_directory); + __Pyx_GIVEREF(__pyx_v_current_directory); + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_current_directory); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_cur_scope; + PyObject *__pyx_v_wraps = NULL; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("currentdir_firstparam", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + + /* "lib/Naked/toolshed/c/system.pyx":95 + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): + * try: # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":96 + * def currentdir_firstparam(func): + * try: + * from functools import wraps # <<<<<<<<<<<<<< + * + * @wraps(func) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_wraps = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":98 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper, 0, __pyx_n_s_currentdir_firstparam_locals_wra, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__11); + + /* "lib/Naked/toolshed/c/system.pyx":98 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_wrapper = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":102 + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + * return wrapper # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":103 + * return func(current_directory, *args, **kwargs) + * return wrapper + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":104 + * return wrapper + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":105 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":106 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wraps); + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam = {__Pyx_NAMESTR("currentdir_lastparam"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam(PyObject *__pyx_self, PyObject *__pyx_v_func) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("currentdir_lastparam (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(__pyx_self, ((PyObject *)__pyx_v_func)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_outer_scope; + PyObject *__pyx_v_the_cwd = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/system.pyx":122 + * @wraps(func) + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() # <<<<<<<<<<<<<< + * return func(*args, current_dir=the_cwd) + * return wrapper + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_the_cwd = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":123 + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) # <<<<<<<<<<<<<< + * return wrapper + * except Exception as e: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_current_dir, __pyx_v_the_cwd) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_the_cwd); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_cur_scope; + PyObject *__pyx_v_wraps = NULL; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("currentdir_lastparam", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + + /* "lib/Naked/toolshed/c/system.pyx":117 + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): + * try: # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":118 + * def currentdir_lastparam(func): + * try: + * from functools import wraps # <<<<<<<<<<<<<< + * + * @wraps(func) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_wraps = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":120 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper, 0, __pyx_n_s_currentdir_lastparam_locals_wrap, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "lib/Naked/toolshed/c/system.pyx":120 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_wrapper = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":124 + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + * return wrapper # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":125 + * return func(*args, current_dir=the_cwd) + * return wrapper + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":126 + * return wrapper + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":127 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":128 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wraps); + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath(PyObject *__pyx_self, PyObject *__pyx_v_file_name); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_15fullpath = {__Pyx_NAMESTR("fullpath"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath(PyObject *__pyx_self, PyObject *__pyx_v_file_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fullpath (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(__pyx_self, ((PyObject *)__pyx_v_file_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("fullpath", 0); + + /* "lib/Naked/toolshed/c/system.pyx":140 + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): + * try: # <<<<<<<<<<<<<< + * return file_name + * except Exception as e: + */ + { + if (__pyx_t_1||__pyx_t_2||__pyx_t_3); else {/*mark used*/}; + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":141 + * def fullpath(file_name): + * try: + * return file_name # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_file_name); + __pyx_r = __pyx_v_file_name; + goto __pyx_L7_try_return; + } + goto __pyx_L10_try_end; + __pyx_L7_try_return:; + goto __pyx_L0; + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_17cwd = {__Pyx_NAMESTR("cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cwd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_kp_s__8); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dir = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cwd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(__pyx_self, __pyx_v_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("cwd", 0); + + /* "lib/Naked/toolshed/c/system.pyx":157 + * @currentdir_firstparam + * def cwd(dir=""): + * try: # <<<<<<<<<<<<<< + * return dir + * except Exception as e: + */ + { + if (__pyx_t_1||__pyx_t_2||__pyx_t_3); else {/*mark used*/}; + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":158 + * def cwd(dir=""): + * try: + * return dir # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dir); + __pyx_r = __pyx_v_dir; + goto __pyx_L7_try_return; + } + goto __pyx_L10_try_end; + __pyx_L7_try_return:; + goto __pyx_L0; + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_19make_dirs = {__Pyx_NAMESTR("make_dirs"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_dirs (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(__pyx_self, ((PyObject *)__pyx_v_dirpath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_errno = NULL; + PyObject *__pyx_v_ose = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_dirs", 0); + + /* "lib/Naked/toolshed/c/system.pyx":177 + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): + * try: # <<<<<<<<<<<<<< + * import os + * import errno + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":178 + * def make_dirs(dirpath): + * try: + * import os # <<<<<<<<<<<<<< + * import errno + * os.makedirs(dirpath) + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":179 + * try: + * import os + * import errno # <<<<<<<<<<<<<< + * os.makedirs(dirpath) + * return True + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_errno, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_errno = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":180 + * import os + * import errno + * os.makedirs(dirpath) # <<<<<<<<<<<<<< + * return True + * except OSError as ose: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_makedirs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":181 + * import errno + * os.makedirs(dirpath) + * return True # <<<<<<<<<<<<<< + * except OSError as ose: + * if ose.errno != errno.EEXIST: # directory already exists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":182 + * os.makedirs(dirpath) + * return True + * except OSError as ose: # <<<<<<<<<<<<<< + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OSError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ose = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":183 + * return True + * except OSError as ose: + * if ose.errno != errno.EEXIST: # directory already exists # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_ose, __pyx_n_s_errno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_v_errno)) { __Pyx_RaiseUnboundLocalError("errno"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_errno, __pyx_n_s_EEXIST); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_RichCompare(__pyx_t_8, __pyx_t_9, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":184 + * except OSError as ose: + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + * raise ose + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":185 + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise ose + * else: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":186 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + * raise ose # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_Raise(__pyx_v_ose, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":188 + * raise ose + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * raise e + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/system.pyx":189 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":190 + * return False + * except Exception as e: + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_errno); + __Pyx_XDECREF(__pyx_v_ose); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21file_exists = {__Pyx_NAMESTR("file_exists"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_exists (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_exists", 0); + + /* "lib/Naked/toolshed/c/system.pyx":204 + * #------------------------------------------------------------------------------ + * def file_exists(filepath): + * try: # <<<<<<<<<<<<<< + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + * return True + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":205 + * def file_exists(filepath): + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":206 + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":208 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":209 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":210 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":211 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":212 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_23is_file = {__Pyx_NAMESTR("is_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_file (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_file", 0); + + /* "lib/Naked/toolshed/c/system.pyx":221 + * #------------------------------------------------------------------------------ + * def is_file(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.isfile(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":222 + * def is_file(filepath): + * try: + * return os.path.isfile(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":223 + * try: + * return os.path.isfile(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":224 + * return os.path.isfile(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":225 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":226 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_25dir_exists = {__Pyx_NAMESTR("dir_exists"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dir_exists (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(__pyx_self, ((PyObject *)__pyx_v_dirpath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dir_exists", 0); + + /* "lib/Naked/toolshed/c/system.pyx":234 + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): + * try: # <<<<<<<<<<<<<< + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + * return True + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":235 + * def dir_exists(dirpath): + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":236 + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":238 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":239 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.dir_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":240 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":241 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":242 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.dir_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_27is_dir = {__Pyx_NAMESTR("is_dir"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_dir (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(__pyx_self, ((PyObject *)__pyx_v_dirpath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_dir", 0); + + /* "lib/Naked/toolshed/c/system.pyx":251 + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): + * try: # <<<<<<<<<<<<<< + * return os.path.isdir(dirpath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":252 + * def is_dir(dirpath): + * try: + * return os.path.isdir(dirpath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":253 + * try: + * return os.path.isdir(dirpath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":254 + * return os.path.isdir(dirpath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":256 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_29file_size = {__Pyx_NAMESTR("file_size"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_size (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_size", 0); + + /* "lib/Naked/toolshed/c/system.pyx":270 + * #------------------------------------------------------------------------------ + * def file_size(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.getsize(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":271 + * def file_size(filepath): + * try: + * return os.path.getsize(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":272 + * try: + * return os.path.getsize(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_size", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":273 + * return os.path.getsize(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":274 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":275 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_size", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_31file_mod_time = {__Pyx_NAMESTR("file_mod_time"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_mod_time (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_time = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_mod_time", 0); + + /* "lib/Naked/toolshed/c/system.pyx":283 + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): + * try: # <<<<<<<<<<<<<< + * import time + * return time.ctime(os.path.getmtime(filepath)) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":284 + * def file_mod_time(filepath): + * try: + * import time # <<<<<<<<<<<<<< + * return time.ctime(os.path.getmtime(filepath)) + * except Exception as e: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_time = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":285 + * try: + * import time + * return time.ctime(os.path.getmtime(filepath)) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getmtime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":286 + * import time + * return time.ctime(os.path.getmtime(filepath)) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_mod_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":287 + * return time.ctime(os.path.getmtime(filepath)) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":288 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":289 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_mod_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_time); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files(PyObject *__pyx_self, PyObject *__pyx_v_dir); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_33list_all_files = {__Pyx_NAMESTR("list_all_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files(PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_all_files (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(__pyx_self, ((PyObject *)__pyx_v_dir)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_filenames = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_all_files", 0); + + /* "lib/Naked/toolshed/c/system.pyx":303 + * #------------------------------------------------------------------------------ + * def list_all_files(dir): + * try: # <<<<<<<<<<<<<< + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + * return filenames + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":304 + * def list_all_files(dir): + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] # <<<<<<<<<<<<<< + * return filenames + * except Exception as e: + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_listdir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isfile); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_12) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_name))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_filenames = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":305 + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + * return filenames # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames); + __pyx_r = __pyx_v_filenames; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":306 + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + * return filenames + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":307 + * return filenames + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_12) { + + /* "lib/Naked/toolshed/c/system.pyx":308 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/system.pyx":309 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_filenames); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_35list_filter_files = {__Pyx_NAMESTR("list_filter_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_extension_filter = 0; + PyObject *__pyx_v_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_filter_files (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extension_filter,&__pyx_n_s_dir,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extension_filter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("list_filter_files", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_filter_files") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_extension_filter = values[0]; + __pyx_v_dir = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_filter_files", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(__pyx_self, __pyx_v_extension_filter, __pyx_v_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_filenames = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_filter_files", 0); + __Pyx_INCREF(__pyx_v_extension_filter); + + /* "lib/Naked/toolshed/c/system.pyx":319 + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): + * try: # <<<<<<<<<<<<<< + * if not extension_filter.startswith("."): + * extension_filter = "." + extension_filter + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":320 + * def list_filter_files(extension_filter, dir): + * try: + * if not extension_filter.startswith("."): # <<<<<<<<<<<<<< + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_extension_filter, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":321 + * try: + * if not extension_filter.startswith("."): + * extension_filter = "." + extension_filter # <<<<<<<<<<<<<< + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + * return filenames + */ + __pyx_t_5 = PyNumber_Add(__pyx_kp_s__24, __pyx_v_extension_filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_extension_filter, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/system.pyx":322 + * if not extension_filter.startswith("."): + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] # <<<<<<<<<<<<<< + * return filenames + * except Exception as e: + */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_listdir); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_11(__pyx_t_4); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_extension_filter); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_extension_filter); + __Pyx_GIVEREF(__pyx_v_extension_filter); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_7) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_v_name))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L14; + } + __pyx_L14:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_filenames = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":323 + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + * return filenames # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames); + __pyx_r = __pyx_v_filenames; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":324 + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + * return filenames + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/system.pyx":325 + * return filenames + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":326 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/system.pyx":327 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_filenames); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_extension_filter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd = {__Pyx_NAMESTR("list_all_files_cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_all_files_cwd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_kp_s__8); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_all_files_cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dir = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_all_files_cwd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(__pyx_self, __pyx_v_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_all_files_cwd", 0); + + /* "lib/Naked/toolshed/c/system.pyx":339 + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): + * try: # <<<<<<<<<<<<<< + * return list_all_files(dir) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":340 + * def list_all_files_cwd(dir=""): + * try: + * return list_all_files(dir) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_all_files); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":341 + * try: + * return list_all_files(dir) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":342 + * return list_all_files(dir) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":343 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":344 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd = {__Pyx_NAMESTR("list_filter_files_cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_extension_filter = 0; + PyObject *__pyx_v_current_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_filter_files_cwd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extension_filter,&__pyx_n_s_current_dir,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__8); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extension_filter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current_dir); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_filter_files_cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_extension_filter = values[0]; + __pyx_v_current_dir = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_filter_files_cwd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(__pyx_self, __pyx_v_extension_filter, __pyx_v_current_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_current_dir) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_filter_files_cwd", 0); + + /* "lib/Naked/toolshed/c/system.pyx":356 + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: # <<<<<<<<<<<<<< + * return list_filter_files(extension_filter, current_dir) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":357 + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: + * return list_filter_files(extension_filter, current_dir) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_filter_files); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_extension_filter); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_extension_filter); + __Pyx_GIVEREF(__pyx_v_extension_filter); + __Pyx_INCREF(__pyx_v_current_dir); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_current_dir); + __Pyx_GIVEREF(__pyx_v_current_dir); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":358 + * try: + * return list_filter_files(extension_filter, current_dir) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":359 + * return list_filter_files(extension_filter, current_dir) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":360 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":361 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_41list_match_files = {__Pyx_NAMESTR("list_match_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_match_pattern = 0; + PyObject *__pyx_v_full_path = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_match_files (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_pattern,&__pyx_n_s_full_path,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_match_pattern)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_full_path); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_match_files") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_match_pattern = values[0]; + __pyx_v_full_path = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_match_files", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(__pyx_self, __pyx_v_match_pattern, __pyx_v_full_path); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_match_pattern, PyObject *__pyx_v_full_path) { + PyObject *__pyx_v_glob = NULL; + PyObject *__pyx_v_filenames = NULL; + PyObject *__pyx_v_filenames_fullpath = NULL; + PyObject *__pyx_v_cwd = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_match_files", 0); + + /* "lib/Naked/toolshed/c/system.pyx":374 + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): + * try: # <<<<<<<<<<<<<< + * from glob import glob + * filenames = glob(match_pattern) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":375 + * def list_match_files(match_pattern, full_path = False): + * try: + * from glob import glob # <<<<<<<<<<<<<< + * filenames = glob(match_pattern) + * if full_path: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_glob); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_glob); + __Pyx_GIVEREF(__pyx_n_s_glob); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_glob, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_glob); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_glob = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":376 + * try: + * from glob import glob + * filenames = glob(match_pattern) # <<<<<<<<<<<<<< + * if full_path: + * filenames_fullpath = [] + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_match_pattern); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_match_pattern); + __Pyx_GIVEREF(__pyx_v_match_pattern); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_glob, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_filenames = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":377 + * from glob import glob + * filenames = glob(match_pattern) + * if full_path: # <<<<<<<<<<<<<< + * filenames_fullpath = [] + * cwd = os.getcwd() + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_full_path); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/system.pyx":378 + * filenames = glob(match_pattern) + * if full_path: + * filenames_fullpath = [] # <<<<<<<<<<<<<< + * cwd = os.getcwd() + * for name in filenames: + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_filenames_fullpath = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":379 + * if full_path: + * filenames_fullpath = [] + * cwd = os.getcwd() # <<<<<<<<<<<<<< + * for name in filenames: + * name = os.path.join(cwd, name) #make the full path to the file + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_cwd = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":380 + * filenames_fullpath = [] + * cwd = os.getcwd() + * for name in filenames: # <<<<<<<<<<<<<< + * name = os.path.join(cwd, name) #make the full path to the file + * filenames_fullpath.append(name) #add to the new list + */ + if (PyList_CheckExact(__pyx_v_filenames) || PyTuple_CheckExact(__pyx_v_filenames)) { + __pyx_t_4 = __pyx_v_filenames; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_filenames); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":381 + * cwd = os.getcwd() + * for name in filenames: + * name = os.path.join(cwd, name) #make the full path to the file # <<<<<<<<<<<<<< + * filenames_fullpath.append(name) #add to the new list + * return filenames_fullpath #then return that list + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_cwd); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_cwd); + __Pyx_GIVEREF(__pyx_v_cwd); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":382 + * for name in filenames: + * name = os.path.join(cwd, name) #make the full path to the file + * filenames_fullpath.append(name) #add to the new list # <<<<<<<<<<<<<< + * return filenames_fullpath #then return that list + * else: + */ + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_filenames_fullpath, __pyx_v_name); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":383 + * name = os.path.join(cwd, name) #make the full path to the file + * filenames_fullpath.append(name) #add to the new list + * return filenames_fullpath #then return that list # <<<<<<<<<<<<<< + * else: + * return filenames + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames_fullpath); + __pyx_r = __pyx_v_filenames_fullpath; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":385 + * return filenames_fullpath #then return that list + * else: + * return filenames # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames); + __pyx_r = __pyx_v_filenames; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":386 + * else: + * return filenames + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_e = __pyx_t_10; + + /* "lib/Naked/toolshed/c/system.pyx":387 + * return filenames + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/system.pyx":388 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/system.pyx":389 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_glob); + __Pyx_XDECREF(__pyx_v_filenames); + __Pyx_XDECREF(__pyx_v_filenames_fullpath); + __Pyx_XDECREF(__pyx_v_cwd); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_43is_link = {__Pyx_NAMESTR("is_link"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_link (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_link", 0); + + /* "lib/Naked/toolshed/c/system.pyx":402 + * #------------------------------------------------------------------------------ + * def is_link(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.islink(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":403 + * def is_link(filepath): + * try: + * return os.path.islink(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_islink); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":404 + * try: + * return os.path.islink(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":405 + * return os.path.islink(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":406 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":407 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_45real_path = {__Pyx_NAMESTR("real_path"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("real_path (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("real_path", 0); + + /* "lib/Naked/toolshed/c/system.pyx":414 + * #------------------------------------------------------------------------------ + * def real_path(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.realpath(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":415 + * def real_path(filepath): + * try: + * return os.path.realpath(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_realpath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":416 + * try: + * return os.path.realpath(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.real_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":417 + * return os.path.realpath(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":418 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":419 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.real_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_47stdout = {__Pyx_NAMESTR("stdout"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout(PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(__pyx_self, ((PyObject *)__pyx_v_text)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout", 0); + + /* "lib/Naked/toolshed/c/system.pyx":432 + * #------------------------------------------------------------------------------ + * def stdout(text): + * try: # <<<<<<<<<<<<<< + * print(text) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":433 + * def stdout(text): + * try: + * print(text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + if (__Pyx_PrintOne(0, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + + /* "lib/Naked/toolshed/c/system.pyx":434 + * try: + * print(text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + */ + __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_4) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":435 + * print(text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":436 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":437 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl = {__Pyx_NAMESTR("stdout_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl(PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout_xnl (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(__pyx_self, ((PyObject *)__pyx_v_text)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout_xnl", 0); + + /* "lib/Naked/toolshed/c/system.pyx":444 + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): + * try: # <<<<<<<<<<<<<< + * sys.stdout.write(text) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":445 + * def stdout_xnl(text): + * try: + * sys.stdout.write(text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":446 + * try: + * sys.stdout.write(text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":447 + * sys.stdout.write(text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":448 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":449 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter(PyObject *__pyx_self, PyObject *__pyx_v_iter); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_51stdout_iter = {__Pyx_NAMESTR("stdout_iter"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter(PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout_iter (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(__pyx_self, ((PyObject *)__pyx_v_iter)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout_iter", 0); + + /* "lib/Naked/toolshed/c/system.pyx":456 + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): + * try: # <<<<<<<<<<<<<< + * for x in iter: + * stdout(x) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":457 + * def stdout_iter(iter): + * try: + * for x in iter: # <<<<<<<<<<<<<< + * stdout(x) + * except Exception as e: + */ + if (PyList_CheckExact(__pyx_v_iter) || PyTuple_CheckExact(__pyx_v_iter)) { + __pyx_t_4 = __pyx_v_iter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":458 + * try: + * for x in iter: + * stdout(x) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_stdout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":459 + * for x in iter: + * stdout(x) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/system.pyx":460 + * stdout(x) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":461 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/system.pyx":462 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl(PyObject *__pyx_self, PyObject *__pyx_v_iter); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl = {__Pyx_NAMESTR("stdout_iter_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl(PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout_iter_xnl (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(__pyx_self, ((PyObject *)__pyx_v_iter)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout_iter_xnl", 0); + + /* "lib/Naked/toolshed/c/system.pyx":470 + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): + * try: # <<<<<<<<<<<<<< + * for x in iter: + * stdout_xnl(x) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":471 + * def stdout_iter_xnl(iter): + * try: + * for x in iter: # <<<<<<<<<<<<<< + * stdout_xnl(x) + * except Exception as e: + */ + if (PyList_CheckExact(__pyx_v_iter) || PyTuple_CheckExact(__pyx_v_iter)) { + __pyx_t_4 = __pyx_v_iter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":472 + * try: + * for x in iter: + * stdout_xnl(x) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_stdout_xnl); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":473 + * for x in iter: + * stdout_xnl(x) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/system.pyx":474 + * stdout_xnl(x) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":475 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/system.pyx":476 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_55stderr = {__Pyx_NAMESTR("stderr"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_exit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stderr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_exit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stderr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_text = values[0]; + __pyx_v_exit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stderr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(__pyx_self, __pyx_v_text, __pyx_v_exit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stderr", 0); + + /* "lib/Naked/toolshed/c/system.pyx":484 + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(text + "\n") + * if exit: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":485 + * def stderr(text, exit=0): + * try: + * sys.stderr.write(text + "\n") # <<<<<<<<<<<<<< + * if exit: + * raise SystemExit(exit) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_v_text, __pyx_kp_s__36); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":486 + * try: + * sys.stderr.write(text + "\n") + * if exit: # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exit); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":487 + * sys.stderr.write(text + "\n") + * if exit: + * raise SystemExit(exit) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_exit); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_exit); + __Pyx_GIVEREF(__pyx_v_exit); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":488 + * if exit: + * raise SystemExit(exit) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":489 + * raise SystemExit(exit) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":490 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":491 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl = {__Pyx_NAMESTR("stderr_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_exit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stderr_xnl (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_exit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stderr_xnl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_text = values[0]; + __pyx_v_exit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stderr_xnl", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(__pyx_self, __pyx_v_text, __pyx_v_exit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stderr_xnl", 0); + + /* "lib/Naked/toolshed/c/system.pyx":498 + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(text) + * if exit: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":499 + * def stderr_xnl(text, exit=0): + * try: + * sys.stderr.write(text) # <<<<<<<<<<<<<< + * if exit: + * raise SystemExit(exit) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":500 + * try: + * sys.stderr.write(text) + * if exit: # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exit); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":501 + * sys.stderr.write(text) + * if exit: + * raise SystemExit(exit) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_exit); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_exit); + __Pyx_GIVEREF(__pyx_v_exit); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":502 + * if exit: + * raise SystemExit(exit) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":503 + * raise SystemExit(exit) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":504 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":505 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_59exit_with_status = {__Pyx_NAMESTR("exit_with_status"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("exit_with_status (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exit,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exit_with_status") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exit = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("exit_with_status", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_with_status", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(__pyx_self, __pyx_v_exit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("exit_with_status", 0); + + /* "lib/Naked/toolshed/c/system.pyx":520 + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): + * raise SystemExit(exit) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_exit); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exit); + __Pyx_GIVEREF(__pyx_v_exit); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_with_status", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_61exit_fail = {__Pyx_NAMESTR("exit_fail"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("exit_fail (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("exit_fail", 0); + + /* "lib/Naked/toolshed/c/system.pyx":528 + * #------------------------------------------------------------------------------ + * def exit_fail(): + * raise SystemExit(1) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_fail", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_63exit_success = {__Pyx_NAMESTR("exit_success"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("exit_success (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("exit_success", 0); + + /* "lib/Naked/toolshed/c/system.pyx":536 + * #------------------------------------------------------------------------------ + * def exit_success(): + * raise SystemExit(0) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct__currentdir_to_basefile"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct_1_currentdir_firstparam"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct_2_currentdir_lastparam"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("system"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_EEXIST, __pyx_k_EEXIST, sizeof(__pyx_k_EEXIST), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_Could_not, __pyx_k_Naked_Framework_Error_Could_not, sizeof(__pyx_k_Naked_Framework_Error_Could_not), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with, __pyx_k_Naked_Framework_Error_error_with, sizeof(__pyx_k_Naked_Framework_Error_error_with), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_2, __pyx_k_Naked_Framework_Error_error_with_2, sizeof(__pyx_k_Naked_Framework_Error_error_with_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_3, __pyx_k_Naked_Framework_Error_error_with_3, sizeof(__pyx_k_Naked_Framework_Error_error_with_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_4, __pyx_k_Naked_Framework_Error_error_with_4, sizeof(__pyx_k_Naked_Framework_Error_error_with_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_5, __pyx_k_Naked_Framework_Error_error_with_5, sizeof(__pyx_k_Naked_Framework_Error_error_with_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_6, __pyx_k_Naked_Framework_Error_error_with_6, sizeof(__pyx_k_Naked_Framework_Error_error_with_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_7, __pyx_k_Naked_Framework_Error_error_with_7, sizeof(__pyx_k_Naked_Framework_Error_error_with_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_10, __pyx_k_Naked_Framework_Error_unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_unable_to_10), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_11, __pyx_k_Naked_Framework_Error_unable_to_11, sizeof(__pyx_k_Naked_Framework_Error_unable_to_11), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_12, __pyx_k_Naked_Framework_Error_unable_to_12, sizeof(__pyx_k_Naked_Framework_Error_unable_to_12), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_13, __pyx_k_Naked_Framework_Error_unable_to_13, sizeof(__pyx_k_Naked_Framework_Error_unable_to_13), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_14, __pyx_k_Naked_Framework_Error_unable_to_14, sizeof(__pyx_k_Naked_Framework_Error_unable_to_14), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_15, __pyx_k_Naked_Framework_Error_unable_to_15, sizeof(__pyx_k_Naked_Framework_Error_unable_to_15), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_16, __pyx_k_Naked_Framework_Error_unable_to_16, sizeof(__pyx_k_Naked_Framework_Error_unable_to_16), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_17, __pyx_k_Naked_Framework_Error_unable_to_17, sizeof(__pyx_k_Naked_Framework_Error_unable_to_17), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_7, __pyx_k_Naked_Framework_Error_unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_8, __pyx_k_Naked_Framework_Error_unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_9, __pyx_k_Naked_Framework_Error_unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_unable_to_9), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, + {&__pyx_n_s_SystemExit, __pyx_k_SystemExit, sizeof(__pyx_k_SystemExit), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0}, + {&__pyx_kp_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_basename, __pyx_k_basename, sizeof(__pyx_k_basename), 0, 0, 1, 1}, + {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1}, + {&__pyx_n_s_current_dir, __pyx_k_current_dir, sizeof(__pyx_k_current_dir), 0, 0, 1, 1}, + {&__pyx_n_s_current_directory, __pyx_k_current_directory, sizeof(__pyx_k_current_directory), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_firstparam, __pyx_k_currentdir_firstparam, sizeof(__pyx_k_currentdir_firstparam), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_firstparam_locals_wra, __pyx_k_currentdir_firstparam_locals_wra, sizeof(__pyx_k_currentdir_firstparam_locals_wra), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_lastparam, __pyx_k_currentdir_lastparam, sizeof(__pyx_k_currentdir_lastparam), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_lastparam_locals_wrap, __pyx_k_currentdir_lastparam_locals_wrap, sizeof(__pyx_k_currentdir_lastparam_locals_wrap), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_to_basefile, __pyx_k_currentdir_to_basefile, sizeof(__pyx_k_currentdir_to_basefile), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_to_basefile_locals_wr, __pyx_k_currentdir_to_basefile_locals_wr, sizeof(__pyx_k_currentdir_to_basefile_locals_wr), 0, 0, 1, 1}, + {&__pyx_n_s_cwd, __pyx_k_cwd, sizeof(__pyx_k_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1}, + {&__pyx_n_s_dir_exists, __pyx_k_dir_exists, sizeof(__pyx_k_dir_exists), 0, 0, 1, 1}, + {&__pyx_n_s_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 0, 1, 1}, + {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, + {&__pyx_n_s_dirpath, __pyx_k_dirpath, sizeof(__pyx_k_dirpath), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_exit_fail, __pyx_k_exit_fail, sizeof(__pyx_k_exit_fail), 0, 0, 1, 1}, + {&__pyx_n_s_exit_success, __pyx_k_exit_success, sizeof(__pyx_k_exit_success), 0, 0, 1, 1}, + {&__pyx_n_s_exit_with_status, __pyx_k_exit_with_status, sizeof(__pyx_k_exit_with_status), 0, 0, 1, 1}, + {&__pyx_n_s_extension_filter, __pyx_k_extension_filter, sizeof(__pyx_k_extension_filter), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1}, + {&__pyx_n_s_file_extension, __pyx_k_file_extension, sizeof(__pyx_k_file_extension), 0, 0, 1, 1}, + {&__pyx_n_s_file_mod_time, __pyx_k_file_mod_time, sizeof(__pyx_k_file_mod_time), 0, 0, 1, 1}, + {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1}, + {&__pyx_n_s_file_size, __pyx_k_file_size, sizeof(__pyx_k_file_size), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_filenames, __pyx_k_filenames, sizeof(__pyx_k_filenames), 0, 0, 1, 1}, + {&__pyx_n_s_filenames_fullpath, __pyx_k_filenames_fullpath, sizeof(__pyx_k_filenames_fullpath), 0, 0, 1, 1}, + {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, + {&__pyx_n_s_full_path, __pyx_k_full_path, sizeof(__pyx_k_full_path), 0, 0, 1, 1}, + {&__pyx_n_s_fullpath, __pyx_k_fullpath, sizeof(__pyx_k_fullpath), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_s_getcwd, __pyx_k_getcwd, sizeof(__pyx_k_getcwd), 0, 0, 1, 1}, + {&__pyx_n_s_getmtime, __pyx_k_getmtime, sizeof(__pyx_k_getmtime), 0, 0, 1, 1}, + {&__pyx_n_s_getsize, __pyx_k_getsize, sizeof(__pyx_k_getsize), 0, 0, 1, 1}, + {&__pyx_n_s_glob, __pyx_k_glob, sizeof(__pyx_k_glob), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_is_dir, __pyx_k_is_dir, sizeof(__pyx_k_is_dir), 0, 0, 1, 1}, + {&__pyx_n_s_is_file, __pyx_k_is_file, sizeof(__pyx_k_is_file), 0, 0, 1, 1}, + {&__pyx_n_s_is_link, __pyx_k_is_link, sizeof(__pyx_k_is_link), 0, 0, 1, 1}, + {&__pyx_n_s_isdir, __pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 0, 1, 1}, + {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1}, + {&__pyx_n_s_islink, __pyx_k_islink, sizeof(__pyx_k_islink), 0, 0, 1, 1}, + {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_system, __pyx_k_lib_Naked_toolshed_c_system, sizeof(__pyx_k_lib_Naked_toolshed_c_system), 0, 0, 1, 1}, + {&__pyx_n_s_list_all_files, __pyx_k_list_all_files, sizeof(__pyx_k_list_all_files), 0, 0, 1, 1}, + {&__pyx_n_s_list_all_files_cwd, __pyx_k_list_all_files_cwd, sizeof(__pyx_k_list_all_files_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_list_filter_files, __pyx_k_list_filter_files, sizeof(__pyx_k_list_filter_files), 0, 0, 1, 1}, + {&__pyx_n_s_list_filter_files_cwd, __pyx_k_list_filter_files_cwd, sizeof(__pyx_k_list_filter_files_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_list_match_files, __pyx_k_list_match_files, sizeof(__pyx_k_list_match_files), 0, 0, 1, 1}, + {&__pyx_n_s_listdir, __pyx_k_listdir, sizeof(__pyx_k_listdir), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_dirs, __pyx_k_make_dirs, sizeof(__pyx_k_make_dirs), 0, 0, 1, 1}, + {&__pyx_n_s_make_path, __pyx_k_make_path, sizeof(__pyx_k_make_path), 0, 0, 1, 1}, + {&__pyx_n_s_makedirs, __pyx_k_makedirs, sizeof(__pyx_k_makedirs), 0, 0, 1, 1}, + {&__pyx_n_s_match_pattern, __pyx_k_match_pattern, sizeof(__pyx_k_match_pattern), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_ose, __pyx_k_ose, sizeof(__pyx_k_ose), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_path_list, __pyx_k_path_list, sizeof(__pyx_k_path_list), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_real_path, __pyx_k_real_path, sizeof(__pyx_k_real_path), 0, 0, 1, 1}, + {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1}, + {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1}, + {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_stderr_xnl, __pyx_k_stderr_xnl, sizeof(__pyx_k_stderr_xnl), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_stdout_iter, __pyx_k_stdout_iter, sizeof(__pyx_k_stdout_iter), 0, 0, 1, 1}, + {&__pyx_n_s_stdout_iter_xnl, __pyx_k_stdout_iter_xnl, sizeof(__pyx_k_stdout_iter_xnl), 0, 0, 1, 1}, + {&__pyx_n_s_stdout_xnl, __pyx_k_stdout_xnl, sizeof(__pyx_k_stdout_xnl), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, + {&__pyx_n_s_the_cwd, __pyx_k_the_cwd, sizeof(__pyx_k_the_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_SystemExit = __Pyx_GetBuiltinName(__pyx_n_s_SystemExit); if (!__pyx_builtin_SystemExit) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/system.pyx":25 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/system.pyx":38 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/system.pyx":52 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/system.pyx":65 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_file_name, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_current_directory, __pyx_n_s_full_path); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":86 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_dir, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_current_directory); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__11 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__8)); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/system.pyx":105 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + __pyx_tuple__13 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_the_cwd); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":127 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_3); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/system.pyx":185 + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise ose + * else: + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Could_not); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/system.pyx":211 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_4); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "lib/Naked/toolshed/c/system.pyx":225 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_5); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/system.pyx":241 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_6); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "lib/Naked/toolshed/c/system.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_7); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "lib/Naked/toolshed/c/system.pyx":274 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_5); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "lib/Naked/toolshed/c/system.pyx":288 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "lib/Naked/toolshed/c/system.pyx":308 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_7); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/system.pyx":320 + * def list_filter_files(extension_filter, dir): + * try: + * if not extension_filter.startswith("."): # <<<<<<<<<<<<<< + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s__24); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "lib/Naked/toolshed/c/system.pyx":326 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_8); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "lib/Naked/toolshed/c/system.pyx":343 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_9); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "lib/Naked/toolshed/c/system.pyx":360 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_10); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "lib/Naked/toolshed/c/system.pyx":388 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_11); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "lib/Naked/toolshed/c/system.pyx":406 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_12); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "lib/Naked/toolshed/c/system.pyx":418 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_13); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "lib/Naked/toolshed/c/system.pyx":436 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_14); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "lib/Naked/toolshed/c/system.pyx":448 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_15); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "lib/Naked/toolshed/c/system.pyx":461 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_16); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "lib/Naked/toolshed/c/system.pyx":475 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_16); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "lib/Naked/toolshed/c/system.pyx":490 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_17); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "lib/Naked/toolshed/c/system.pyx":504 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_17); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "lib/Naked/toolshed/c/system.pyx":528 + * #------------------------------------------------------------------------------ + * def exit_fail(): + * raise SystemExit(1) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "lib/Naked/toolshed/c/system.pyx":536 + * #------------------------------------------------------------------------------ + * def exit_success(): + * raise SystemExit(0) # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_filename, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_extension, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_directory, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_path_list, __pyx_n_s_e); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_path, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_to_basefile, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_firstparam, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_lastparam, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_file_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_fullpath, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_cwd, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_dirpath, __pyx_n_s_os, __pyx_n_s_errno, __pyx_n_s_ose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_dirs, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_exists, 203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_file, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_dirpath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_dir_exists, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_dirpath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_dir, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_size, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_filepath, __pyx_n_s_time, __pyx_n_s_e); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_mod_time, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_dir, __pyx_n_s_filenames, __pyx_n_s_e, __pyx_n_s_name); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_all_files, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_extension_filter, __pyx_n_s_dir, __pyx_n_s_filenames, __pyx_n_s_e, __pyx_n_s_name); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_filter_files, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_all_files_cwd, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + __pyx_tuple__79 = PyTuple_Pack(3, __pyx_n_s_extension_filter, __pyx_n_s_current_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_filter_files_cwd, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_match_pattern, __pyx_n_s_full_path, __pyx_n_s_glob, __pyx_n_s_filenames, __pyx_n_s_filenames_fullpath, __pyx_n_s_cwd, __pyx_n_s_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_match_files, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_link, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_real_path, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_xnl, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_iter, __pyx_n_s_x, __pyx_n_s_e); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_iter, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_iter, __pyx_n_s_x, __pyx_n_s_e); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_iter_xnl, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_exit, __pyx_n_s_e); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stderr, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_exit, __pyx_n_s_e); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stderr_xnl, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_exit); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_with_status, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_fail, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_success, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initsystem(void); /*proto*/ +PyMODINIT_FUNC initsystem(void) +#else +PyMODINIT_FUNC PyInit_system(void); /*proto*/ +PyMODINIT_FUNC PyInit_system(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_system(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("system"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__system) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.system")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.system", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/system.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * import os + * from Naked.settings import debug as DEBUG_FLAG + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":6 + * + * import sys + * import os # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":7 + * import sys + * import os + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_1filename, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_filename, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_3file_extension, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_extension, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_5directory, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_directory, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_7make_path, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_path, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_to_basefile, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_firstparam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_lastparam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":138 + * # Tests: test_SYSTEM.py :: test_sys_full_path_to_file + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function # <<<<<<<<<<<<<< + * def fullpath(file_name): + * try: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_to_basefile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_15fullpath, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/system.pyx":138 + * # Tests: test_SYSTEM.py :: test_sys_full_path_to_file + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function # <<<<<<<<<<<<<< + * def fullpath(file_name): + * try: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fullpath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":155 + * # Tests: test_SYSTEM.py :: test_sys_cwd_path + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def cwd(dir=""): + * try: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_firstparam); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_17cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/system.pyx":155 + * # Tests: test_SYSTEM.py :: test_sys_cwd_path + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def cwd(dir=""): + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cwd, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_19make_dirs, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_dirs, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21file_exists, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_exists, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_23is_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_25dir_exists, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dir_exists, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_27is_dir, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_dir, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_29file_size, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_31file_mod_time, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_mod_time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_33list_all_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_all_files, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_35list_filter_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_filter_files, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":337 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def list_all_files_cwd(dir=""): + * try: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_firstparam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/system.pyx":337 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def list_all_files_cwd(dir=""): + * try: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_all_files_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":354 + * # Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch + * #------------------------------------------------------------------------------ + * @currentdir_lastparam # <<<<<<<<<<<<<< + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_lastparam); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/system.pyx":354 + * # Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch + * #------------------------------------------------------------------------------ + * @currentdir_lastparam # <<<<<<<<<<<<<< + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_filter_files_cwd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_41list_match_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_match_files, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_43is_link, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_link, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_45real_path, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_real_path, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_47stdout, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_51stdout_iter, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_iter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_iter_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_55stderr, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stderr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stderr_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_59exit_with_status, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_with_status, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_61exit_fail, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_fail, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_63exit_success, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_success, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":540 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/system.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.system", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.system"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CPYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.pyx new file mode 100644 index 00000000..3c11a5da --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/system.pyx @@ -0,0 +1,554 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +import os +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY PATHS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filename function ] (string) +# returns file name from a file path (including the file extension) +# Tests: test_SYSTEM.py :: test_sys_filename +#------------------------------------------------------------------------------ +def filename(filepath): + try: + return os.path.basename(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_extension function ] (string) +# returns file extension from a filepath +# Tests: test_SYSTEM.py :: test_sys_file_extension +#------------------------------------------------------------------------------ +def file_extension(filepath): + try: + return os.path.splitext(filepath)[1] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ directory function ] (string) +# returns directory path to the filepath +# Tests: test_SYSTEM.py :: test_sys_dir_path +#------------------------------------------------------------------------------ +def directory(filepath): + try: + return os.path.dirname(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ make_path function ] (string) +# returns OS independent file path from tuple of path components +# Tests: test_SYSTEM.py :: test_sys_make_filepath +#------------------------------------------------------------------------------ +def make_path(*path_list): + try: + return os.path.join(*path_list) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_to_basefile decorator function ] (returns decorated original function) +# concatenates the absolute working directory path to the basename of file in the first parameter of the undecorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile +#------------------------------------------------------------------------------ +def currentdir_to_basefile(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(file_name, *args, **kwargs): + current_directory = os.getcwd() #get current working directory path + full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ currentdir_firstparam decorator function ] (returns decorated original function) +# adds the current working directory as the first function parameter of the decorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg +#------------------------------------------------------------------------------ +def currentdir_firstparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(dir="", *args, **kwargs): + current_directory = os.getcwd() + return func(current_directory, *args, **kwargs) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_lastargument decorator function ] (returns decorated original function) +# adds the current working directory as the last function parameter of the decorated function +# Note: you cannot use other named arguments in the original function with this decorator +# Note: the current directory argument in the last position must be named current_dir +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg +#------------------------------------------------------------------------------ +def currentdir_lastparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(*args, **kwargs): + the_cwd = os.getcwd() + return func(*args, current_dir=the_cwd) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ fullpath function ] (string) +# returns the absolute path to a file that is in the current working directory +# file_name = the basename of the file in the current working directory +# Example usage where test.txt is in working directory: +# filepath = fullpath("test.txt") +# Tests: test_SYSTEM.py :: test_sys_full_path_to_file +#------------------------------------------------------------------------------ +@currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function +def fullpath(file_name): + try: + return file_name + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return absolute path to the file with the fullpath() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ cwd function ] (string) +# returns the current working directory path +# does not need to be called with an argument, the decorator assigns it +# Example usage: +# current_dir = cwd() +# Tests: test_SYSTEM.py :: test_sys_cwd_path +#------------------------------------------------------------------------------ +@currentdir_firstparam +def cwd(dir=""): + try: + return dir + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the current working directory with the cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DIRECTORY WRITES +# +#------------------------------------------------------------------------------ + +## TODO: add tests +#------------------------------------------------------------------------------ +# [ make_dirs function ] (--none--) +# make a new directory path (recursive if multiple levels of depth) if it +# DOES NOT already exist +#------------------------------------------------------------------------------ +def make_dirs(dirpath): + try: + import os + import errno + os.makedirs(dirpath) + return True + except OSError as ose: + if ose.errno != errno.EEXIST: # directory already exists + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + raise ose + else: + return False + except Exception as e: + raise e + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ file_exists function ] (boolean) +# return boolean for existence of file in specified path +# Tests: test_SYSTEM.py :: test_file_exists +#------------------------------------------------------------------------------ +def file_exists(filepath): + try: + if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_file function ] (boolean) +# returns boolean for determination of whether filepath is a file +# Tests: test_SYSTEM.py :: test_sys_is_file, test_sys_is_file_missing_file, +# test_sys_is_file_when_dir +#------------------------------------------------------------------------------ +def is_file(filepath): + try: + return os.path.isfile(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ dir_exists function ] (boolean) +# return boolean for existence of directory in specified path +# Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir +#------------------------------------------------------------------------------ +def dir_exists(dirpath): + try: + if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_dir function ] (boolean) +# returns boolean for determination of whether dirpath is a directory +# Tests: test_SYSTEM.py :: test_sys_dir_is_dir, test_sys_dir_is_dir_when_file, +# test_sys_dir_is_dir_when_missing +#------------------------------------------------------------------------------ +def is_dir(dirpath): + try: + return os.path.isdir(dirpath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE METADATA +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filesize function ] (int) +# return file size in bytes +# Tests: test_SYSTEM.py :: test_sys_meta_file_size +#------------------------------------------------------------------------------ +def file_size(filepath): + try: + return os.path.getsize(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_mod_time function ] (string) +# return the last file modification date/time +# Tests: test_SYSTEM.py :: test_sys_meta_file_mod +#------------------------------------------------------------------------------ +def file_mod_time(filepath): + try: + import time + return time.ctime(os.path.getmtime(filepath)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE LISTINGS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ list_all_files function ] (list) +# returns a list of all files in developer specified directory +# Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir +#------------------------------------------------------------------------------ +def list_all_files(dir): + try: + filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files function ] (list) +# returns a list of files filtered by developer defined file extension in developer defined directory +# Usage example: +# filenames = list_filter_files("py", "tests") +# Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch +#------------------------------------------------------------------------------ +def list_filter_files(extension_filter, dir): + try: + if not extension_filter.startswith("."): + extension_filter = "." + extension_filter + filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_all_files_cwd function ] (list) +# returns a list of all files in the current working directory +# Note: does not require argument, the decorator assigns the cwd +# Usage example: +# file_list = list_all_files_cwd() +# Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd +#------------------------------------------------------------------------------ +@currentdir_firstparam +def list_all_files_cwd(dir=""): + try: + return list_all_files(dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files_cwd function ] (list) +# returns a list of all files in the current working directory filtered by developer specified file extension +# Note: do not specify the second argument, decorator assigns it +# Usage example: +# file_list = list_filter_files_cwd(".py") +# Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch +#------------------------------------------------------------------------------ +@currentdir_lastparam +def list_filter_files_cwd(extension_filter, current_dir=""): + try: + return list_filter_files(extension_filter, current_dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ list_match_files function ] (list) +# returns a list of all files that match the developer specified wildcard match pattern +# can optionally specify return of full path to the files (rather than relative path from cwd) by setting full_path to True +# Usage examples: +# file_list = list_match_files("*.py") +# file_list_fullpath = list_match_files("*.py", True) +# Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath +#------------------------------------------------------------------------------ +def list_match_files(match_pattern, full_path = False): + try: + from glob import glob + filenames = glob(match_pattern) + if full_path: + filenames_fullpath = [] + cwd = os.getcwd() + for name in filenames: + name = os.path.join(cwd, name) #make the full path to the file + filenames_fullpath.append(name) #add to the new list + return filenames_fullpath #then return that list + else: + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# SYMBOLIC LINK TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ is_link function ] (boolean) +# return boolean indicating whether the path is a symbolic link +#------------------------------------------------------------------------------ +def is_link(filepath): + try: + return os.path.islink(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ real_path function ] (string) +# return the real file path pointed to by a symbolic link +#------------------------------------------------------------------------------ +def real_path(filepath): + try: + return os.path.realpath(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DATA STREAMS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ stdout function ] +# print to std output stream +#------------------------------------------------------------------------------ +def stdout(text): + try: + print(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_xnl function ] +# print to std output stream without a newline +#------------------------------------------------------------------------------ +def stdout_xnl(text): + try: + sys.stdout.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_iter function ] +# print items in an iterable to the standard output stream with newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter(iter): + try: + for x in iter: + stdout(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ stdout_iter_xnl function ] +# print items in an iterable to the standard output stream without newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter_xnl(iter): + try: + for x in iter: + stdout_xnl(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr function ] +# print to std error stream +# optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code +#------------------------------------------------------------------------------ +def stderr(text, exit=0): + try: + sys.stderr.write(text + "\n") + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr_xnl function ] +# print to the standard error stream without a newline character after the `text` string +#------------------------------------------------------------------------------ +def stderr_xnl(text, exit=0): + try: + sys.stderr.write(text) + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# APPLICATION CONTROL +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ exit_with_status function ] +# application exit with developer specified exit status code (default = 0) +# use an exit status integer argument +# Tests: test_SYSTEM.py :: test_sys_exit_with_code +#------------------------------------------------------------------------------ +def exit_with_status(exit=0): + raise SystemExit(exit) + +#------------------------------------------------------------------------------ +# [ exit_fail function ] +# application exit with status code 1 +# Tests: test_SYSTEM.py :: test_sys_exit_failure +#------------------------------------------------------------------------------ +def exit_fail(): + raise SystemExit(1) + +#------------------------------------------------------------------------------ +# [ exit_success function] +# application exit with status code 0 +# Tests: test_SYSTEM.py :: test_sys_exit_success +#------------------------------------------------------------------------------ +def exit_success(): + raise SystemExit(0) + + + +if __name__ == '__main__': + pass + # #------------------------------------------------------------------------------ + # # Standard Output Tests + # #------------------------------------------------------------------------------ + # stdout("This is a test") + # for x in range(10): + # stdout_xnl(str(x) + " ") + # list_ten = ['10% ', '20% ', '30% ', '40% ', '50% ', '60% ', '70% ', '80% ', '90% ', '100%'] + # stdout_iter(list_ten) + # #------------------------------------------------------------------------------ + # # Standard Error Tests + # #------------------------------------------------------------------------------ + # stderr("This is a test") + # stderr("This is a test", 1) #exit with status code 1 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.c b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.c new file mode 100644 index 00000000..2c314d35 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.c @@ -0,0 +1,24613 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__types +#define __PYX_HAVE_API__lib__Naked__toolshed__c__types +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "types.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_defaults; +typedef struct __pyx_defaults __pyx_defaults; +struct __pyx_defaults1; +typedef struct __pyx_defaults1 __pyx_defaults1; +struct __pyx_defaults2; +typedef struct __pyx_defaults2 __pyx_defaults2; +struct __pyx_defaults3; +typedef struct __pyx_defaults3 __pyx_defaults3; +struct __pyx_defaults4; +typedef struct __pyx_defaults4 __pyx_defaults4; +struct __pyx_defaults5; +typedef struct __pyx_defaults5 __pyx_defaults5; +struct __pyx_defaults6; +typedef struct __pyx_defaults6 __pyx_defaults6; +struct __pyx_defaults7; +typedef struct __pyx_defaults7 __pyx_defaults7; +struct __pyx_defaults8; +typedef struct __pyx_defaults8 __pyx_defaults8; +struct __pyx_defaults9; +typedef struct __pyx_defaults9 __pyx_defaults9; +struct __pyx_defaults10; +typedef struct __pyx_defaults10 __pyx_defaults10; +struct __pyx_defaults11; +typedef struct __pyx_defaults11 __pyx_defaults11; +struct __pyx_defaults12; +typedef struct __pyx_defaults12 __pyx_defaults12; +struct __pyx_defaults { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults1 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults2 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults3 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults4 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults5 { + PyObject *__pyx_arg_initial_iterable; + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults6 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults7 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults8 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults9 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults10 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults11 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults12 { + PyObject *__pyx_arg_attributes; +}; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define Pyx_PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.types' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.types" +int __pyx_module_is_main_lib__Naked__toolshed__c__types = 0; + +/* Implementation of 'lib.Naked.toolshed.c.types' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_max; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_min; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_4_equal_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_6_equal_attributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_12equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_14type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dict_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_12conditional_map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_14map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_16val_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_18max_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_20min_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_22sum_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_24val_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_26val_count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_28difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_30intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_32key_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_34random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_36random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_38xitems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_lists); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_12join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_separator); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_14postfix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_after); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_16prefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_18surround(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before, PyObject *__pyx_v_after); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_20max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_22min(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_24sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_26count_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_28remove_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_30difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_32intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_34map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_36conditional_map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_38count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_test_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_40random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_42random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_44shuffle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_46wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_48multi_wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcards); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_50xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_52xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_54xtuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_initial_iterable, PyObject *__pyx_v_attributes, PyObject *__pyx_v_max_length, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_2__lshift__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_6xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_8xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_set, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_4xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_6xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_8type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_6concat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_strings); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_substring); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_10xsplit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_12xsplit_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_14begins(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_begin_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_16ends(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_end_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_18wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_20unicode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, CYTHON_UNUSED PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_6__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_attribute); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__cmp__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_10_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_12type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_tuple, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_e[] = "e"; +static char __pyx_k_x[] = "x"; +static char __pyx_k__5[] = ""; +static char __pyx_k__6[] = "|"; +static char __pyx_k__8[] = "["; +static char __pyx_k__9[] = "]"; +static char __pyx_k_eq[] = "__eq__"; +static char __pyx_k_ne[] = "__ne__"; +static char __pyx_k_re[] = "re"; +static char __pyx_k_wc[] = "wc"; +static char __pyx_k_add[] = "__add__"; +static char __pyx_k_cls[] = "cls"; +static char __pyx_k_cmp[] = "__cmp__"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_len[] = "__len__"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_new[] = "__new__"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_pop[] = "pop"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_NFKD[] = "NFKD"; +static char __pyx_k_XSet[] = "XSet"; +static char __pyx_k_dict[] = "__dict__"; +static char __pyx_k_ends[] = "ends"; +static char __pyx_k_iadd[] = "__iadd__"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_item[] = "item"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_push[] = "push"; +static char __pyx_k_repr[] = "__repr__"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_type[] = "type"; +static char __pyx_k_xset[] = "xset"; +static char __pyx_k_UTF_8[] = "UTF-8"; +static char __pyx_k_XDict[] = "XDict"; +static char __pyx_k_XFSet[] = "XFSet"; +static char __pyx_k_XList[] = "XList"; +static char __pyx_k_after[] = "after"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_deque[] = "deque"; +static char __pyx_k_heapq[] = "heapq"; +static char __pyx_k_index[] = "_index"; +static char __pyx_k_items[] = "items"; +static char __pyx_k_lower[] = "lower"; +static char __pyx_k_queue[] = "_queue"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_xfset[] = "xfset"; +static char __pyx_k_xlist[] = "xlist"; +static char __pyx_k_XQueue[] = "XQueue"; +static char __pyx_k_XTuple[] = "XTuple"; +static char __pyx_k_before[] = "before"; +static char __pyx_k_begins[] = "begins"; +static char __pyx_k_choice[] = "choice"; +static char __pyx_k_concat[] = "concat"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_delim2[] = "delim2"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_equals[] = "equals"; +static char __pyx_k_extend[] = "extend"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_length[] = "length"; +static char __pyx_k_lshift[] = "__lshift__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_prefix[] = "prefix"; +static char __pyx_k_random[] = "random"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_sample[] = "sample"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_update[] = "update"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_xitems[] = "xitems"; +static char __pyx_k_xsplit[] = "xsplit"; +static char __pyx_k_xtuple[] = "xtuple"; +static char __pyx_k_XString[] = "XString"; +static char __pyx_k_fnmatch[] = "fnmatch"; +static char __pyx_k_getattr[] = "__getattr__"; +static char __pyx_k_heappop[] = "heappop"; +static char __pyx_k_index_2[] = "index"; +static char __pyx_k_max_val[] = "max_val"; +static char __pyx_k_min_val[] = "min_val"; +static char __pyx_k_postfix[] = "postfix"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_pushpop[] = "pushpop"; +static char __pyx_k_set_obj[] = "set_obj"; +static char __pyx_k_shuffle[] = "shuffle"; +static char __pyx_k_str_obj[] = "str_obj"; +static char __pyx_k_strings[] = "strings"; +static char __pyx_k_subitem[] = "subitem"; +static char __pyx_k_the_key[] = "the_key"; +static char __pyx_k_the_set[] = "the_set"; +static char __pyx_k_tup_obj[] = "tup_obj"; +static char __pyx_k_unicode[] = "unicode"; +static char __pyx_k_wc_list[] = "wc_list"; +static char __pyx_k_XMaxHeap[] = "XMaxHeap"; +static char __pyx_k_XMinHeap[] = "XMinHeap"; +static char __pyx_k_XUnicode[] = "XUnicode"; +static char __pyx_k_contains[] = "contains"; +static char __pyx_k_count_ci[] = "count_ci"; +static char __pyx_k_dict_obj[] = "dict_obj"; +static char __pyx_k_heappush[] = "heappush"; +static char __pyx_k_list_obj[] = "list_obj"; +static char __pyx_k_new_dict[] = "new_dict"; +static char __pyx_k_priority[] = "priority"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_str_list[] = "str_list"; +static char __pyx_k_sum_vals[] = "sum_vals"; +static char __pyx_k_surround[] = "surround"; +static char __pyx_k_the_list[] = "the_list"; +static char __pyx_k_wildcard[] = "wildcard"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_XList_max[] = "XList.max"; +static char __pyx_k_XList_min[] = "XList.min"; +static char __pyx_k_XList_sum[] = "XList.sum"; +static char __pyx_k_XUnicode2[] = "XUnicode2"; +static char __pyx_k_XUnicode3[] = "XUnicode3"; +static char __pyx_k_attr_dict[] = "attr_dict"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_iteritems[] = "iteritems"; +static char __pyx_k_key_xlist[] = "key_xlist"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_norm_text[] = "norm_text"; +static char __pyx_k_normalize[] = "normalize"; +static char __pyx_k_other_obj[] = "other_obj"; +static char __pyx_k_separator[] = "separator"; +static char __pyx_k_substring[] = "substring"; +static char __pyx_k_temp_list[] = "temp_list"; +static char __pyx_k_the_tuple[] = "the_tuple"; +static char __pyx_k_val_count[] = "val_count"; +static char __pyx_k_val_xlist[] = "val_xlist"; +static char __pyx_k_wildcards[] = "wildcards"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_XDict___eq[] = "XDict.__eq__"; +static char __pyx_k_XDict___ne[] = "XDict.__ne__"; +static char __pyx_k_XFSet_type[] = "XFSet.type"; +static char __pyx_k_XFSet_xset[] = "XFSet.xset"; +static char __pyx_k_XList___eq[] = "XList.__eq__"; +static char __pyx_k_XList___ne[] = "XList.__ne__"; +static char __pyx_k_XList_join[] = "XList.join"; +static char __pyx_k_XList_xset[] = "XList.xset"; +static char __pyx_k_XSet_xfset[] = "XSet.xfset"; +static char __pyx_k_XSet_xlist[] = "XSet.xlist"; +static char __pyx_k_XUnicode_2[] = "XUnicode_2"; +static char __pyx_k_XUnicode_3[] = "XUnicode_3"; +static char __pyx_k_attributes[] = "attributes"; +static char __pyx_k_difference[] = "difference"; +static char __pyx_k_end_string[] = "end_string"; +static char __pyx_k_equal_type[] = "_equal_type"; +static char __pyx_k_first_list[] = "first_list"; +static char __pyx_k_max_length[] = "max_length"; +static char __pyx_k_naked_type[] = "naked_type"; +static char __pyx_k_other_dict[] = "other_dict"; +static char __pyx_k_test_value[] = "test_value"; +static char __pyx_k_the_object[] = "the_object"; +static char __pyx_k_value_name[] = "value_name"; +static char __pyx_k_xsplit_set[] = "xsplit_set"; +static char __pyx_k_NakedObject[] = "NakedObject"; +static char __pyx_k_XDict___add[] = "XDict.__add__"; +static char __pyx_k_XFSet___new[] = "XFSet.__new__"; +static char __pyx_k_XFSet_xlist[] = "XFSet.xlist"; +static char __pyx_k_XList___add[] = "XList.__add__"; +static char __pyx_k_XList_xfset[] = "XList.xfset"; +static char __pyx_k_XSet___iadd[] = "XSet.__iadd__"; +static char __pyx_k_XSet___init[] = "XSet.__init__"; +static char __pyx_k_XTuple_type[] = "XTuple.type"; +static char __pyx_k_another_set[] = "another_set"; +static char __pyx_k_collections[] = "collections"; +static char __pyx_k_fnmatchcase[] = "fnmatchcase"; +static char __pyx_k_map_to_vals[] = "map_to_vals"; +static char __pyx_k_other_lists[] = "other_lists"; +static char __pyx_k_result_list[] = "result_list"; +static char __pyx_k_return_list[] = "return_list"; +static char __pyx_k_string_text[] = "string_text"; +static char __pyx_k_test_string[] = "test_string"; +static char __pyx_k_unicodedata[] = "unicodedata"; +static char __pyx_k_XDict___iadd[] = "XDict.__iadd__"; +static char __pyx_k_XDict___init[] = "XDict.__init__"; +static char __pyx_k_XDict_equals[] = "XDict.equals"; +static char __pyx_k_XDict_random[] = "XDict.random"; +static char __pyx_k_XDict_xitems[] = "XDict.xitems"; +static char __pyx_k_XList___iadd[] = "XList.__iadd__"; +static char __pyx_k_XList___init[] = "XList.__init__"; +static char __pyx_k_XList_equals[] = "XList.equals"; +static char __pyx_k_XList_prefix[] = "XList.prefix"; +static char __pyx_k_XList_random[] = "XList.random"; +static char __pyx_k_XList_xtuple[] = "XList.xtuple"; +static char __pyx_k_XMaxHeap_pop[] = "XMaxHeap.pop"; +static char __pyx_k_XMinHeap_pop[] = "XMinHeap.pop"; +static char __pyx_k_XString_ends[] = "XString.ends"; +static char __pyx_k_XString_type[] = "XString.type"; +static char __pyx_k_XTuple___new[] = "XTuple.__new__"; +static char __pyx_k_another_dict[] = "another_dict"; +static char __pyx_k_another_list[] = "another_list"; +static char __pyx_k_begin_string[] = "begin_string"; +static char __pyx_k_intersection[] = "intersection"; +static char __pyx_k_map_to_items[] = "map_to_items"; +static char __pyx_k_naked_type_2[] = "_naked_type_"; +static char __pyx_k_norm_unicode[] = "norm_unicode"; +static char __pyx_k_other_string[] = "other_string"; +static char __pyx_k_val_count_ci[] = "val_count_ci"; +static char __pyx_k_version_info[] = "version_info"; +static char __pyx_k_XDict_max_val[] = "XDict.max_val"; +static char __pyx_k_XDict_min_val[] = "XDict.min_val"; +static char __pyx_k_XList_postfix[] = "XList.postfix"; +static char __pyx_k_XList_shuffle[] = "XList.shuffle"; +static char __pyx_k_XMaxHeap_push[] = "XMaxHeap.push"; +static char __pyx_k_XMinHeap_push[] = "XMinHeap.push"; +static char __pyx_k_XQueue___init[] = "XQueue.__init__"; +static char __pyx_k_XSet___lshift[] = "XSet.__lshift__"; +static char __pyx_k_XString___new[] = "XString.__new__"; +static char __pyx_k_XUnicode_type[] = "XUnicode.type"; +static char __pyx_k_random_sample[] = "random_sample"; +static char __pyx_k_the_attribute[] = "the_attribute"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_XDict_sum_vals[] = "XDict.sum_vals"; +static char __pyx_k_XList_count_ci[] = "XList.count_ci"; +static char __pyx_k_XList_surround[] = "XList.surround"; +static char __pyx_k_XMaxHeap___len[] = "XMaxHeap.__len__"; +static char __pyx_k_XMinHeap___len[] = "XMinHeap.__len__"; +static char __pyx_k_XString_begins[] = "XString.begins"; +static char __pyx_k_XString_concat[] = "XString.concat"; +static char __pyx_k_XString_xsplit[] = "XString.xsplit"; +static char __pyx_k_XUnicode___cmp[] = "XUnicode.__cmp__"; +static char __pyx_k_XUnicode___str[] = "XUnicode.__str__"; +static char __pyx_k_naked_u_string[] = "naked_u_string"; +static char __pyx_k_wildcard_match[] = "wildcard_match"; +static char __pyx_k_XDict_key_xlist[] = "XDict.key_xlist"; +static char __pyx_k_XDict_val_count[] = "XDict.val_count"; +static char __pyx_k_XDict_val_xlist[] = "XDict.val_xlist"; +static char __pyx_k_XMaxHeap___init[] = "XMaxHeap.__init__"; +static char __pyx_k_XMaxHeap_length[] = "XMaxHeap.length"; +static char __pyx_k_XMinHeap___init[] = "XMinHeap.__init__"; +static char __pyx_k_XMinHeap_length[] = "XMinHeap.length"; +static char __pyx_k_XString_unicode[] = "XString.unicode"; +static char __pyx_k_XUnicode___init[] = "XUnicode.__init__"; +static char __pyx_k_XUnicode___repr[] = "XUnicode.__repr__"; +static char __pyx_k_mapped_function[] = "mapped_function"; +static char __pyx_k_nkd_fnmatchcase[] = "nkd_fnmatchcase"; +static char __pyx_k_number_of_items[] = "number_of_items"; +static char __pyx_k_random_key_list[] = "random_key_list"; +static char __pyx_k_split_delimiter[] = "split_delimiter"; +static char __pyx_k_the_string_text[] = "the_string_text"; +static char __pyx_k_NakedObject___eq[] = "NakedObject.__eq__"; +static char __pyx_k_NakedObject___ne[] = "NakedObject.__ne__"; +static char __pyx_k_NakedObject_type[] = "NakedObject.type"; +static char __pyx_k_XDict_difference[] = "XDict.difference"; +static char __pyx_k_XList_difference[] = "XList.difference"; +static char __pyx_k_XMaxHeap_pushpop[] = "XMaxHeap.pushpop"; +static char __pyx_k_XMinHeap_pushpop[] = "XMinHeap.pushpop"; +static char __pyx_k_XString_contains[] = "XString.contains"; +static char __pyx_k_count_duplicates[] = "count_duplicates"; +static char __pyx_k_equal_attributes[] = "_equal_attributes"; +static char __pyx_k_getAttributeDict[] = "_getAttributeDict"; +static char __pyx_k_initial_iterable[] = "initial_iterable"; +static char __pyx_k_py_major_version[] = "py_major_version"; +static char __pyx_k_XDict_map_to_vals[] = "XDict.map_to_vals"; +static char __pyx_k_remove_duplicates[] = "remove_duplicates"; +static char __pyx_k_NakedObject___init[] = "NakedObject.__init__"; +static char __pyx_k_NakedObject_equals[] = "NakedObject.equals"; +static char __pyx_k_XDict_intersection[] = "XDict.intersection"; +static char __pyx_k_XDict_val_count_ci[] = "XDict.val_count_ci"; +static char __pyx_k_XList_intersection[] = "XList.intersection"; +static char __pyx_k_XList_map_to_items[] = "XList.map_to_items"; +static char __pyx_k_XString_xsplit_set[] = "XString.xsplit_set"; +static char __pyx_k_XUnicode___getattr[] = "XUnicode.__getattr__"; +static char __pyx_k_XDict_random_sample[] = "XDict.random_sample"; +static char __pyx_k_XList_random_sample[] = "XList.random_sample"; +static char __pyx_k_XList_wildcard_match[] = "XList.wildcard_match"; +static char __pyx_k_conditional_function[] = "conditional_function"; +static char __pyx_k_multi_wildcard_match[] = "multi_wildcard_match"; +static char __pyx_k_Naked_toolshed_python[] = "Naked.toolshed.python"; +static char __pyx_k_XList_count_duplicates[] = "XList.count_duplicates"; +static char __pyx_k_XString_wildcard_match[] = "XString.wildcard_match"; +static char __pyx_k_NakedObject__equal_type[] = "NakedObject._equal_type"; +static char __pyx_k_XFSet__getAttributeDict[] = "XFSet._getAttributeDict"; +static char __pyx_k_XList_remove_duplicates[] = "XList.remove_duplicates"; +static char __pyx_k_conditional_map_to_vals[] = "conditional_map_to_vals"; +static char __pyx_k_XTuple__getAttributeDict[] = "XTuple._getAttributeDict"; +static char __pyx_k_conditional_map_to_items[] = "conditional_map_to_items"; +static char __pyx_k_XString__getAttributeDict[] = "XString._getAttributeDict"; +static char __pyx_k_XList_multi_wildcard_match[] = "XList.multi_wildcard_match"; +static char __pyx_k_XUnicode__getAttributeDict[] = "XUnicode._getAttributeDict"; +static char __pyx_k_lib_Naked_toolshed_c_types[] = "lib.Naked.toolshed.c.types"; +static char __pyx_k_NakedObject__equal_attributes[] = "NakedObject._equal_attributes"; +static char __pyx_k_NakedObject__getAttributeDict[] = "NakedObject._getAttributeDict"; +static char __pyx_k_XDict_conditional_map_to_vals[] = "XDict.conditional_map_to_vals"; +static char __pyx_k_XList_conditional_map_to_items[] = "XList.conditional_map_to_items"; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/types.pyx"; +static char __pyx_k_XUnicode___init___locals_XUnicod[] = "XUnicode.__init__..XUnicode_2"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)"; +static char __pyx_k_XUnicode___init___locals_XUnicod_2[] = "XUnicode.__init__..XUnicode_2.__new__"; +static char __pyx_k_XUnicode___init___locals_XUnicod_3[] = "XUnicode.__init__..XUnicode_3"; +static char __pyx_k_XUnicode___init___locals_XUnicod_4[] = "XUnicode.__init__..XUnicode_3.__new__"; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_NFKD; +static PyObject *__pyx_n_s_NakedObject; +static PyObject *__pyx_n_s_NakedObject___eq; +static PyObject *__pyx_n_s_NakedObject___init; +static PyObject *__pyx_n_s_NakedObject___ne; +static PyObject *__pyx_n_s_NakedObject__equal_attributes; +static PyObject *__pyx_n_s_NakedObject__equal_type; +static PyObject *__pyx_n_s_NakedObject__getAttributeDict; +static PyObject *__pyx_n_s_NakedObject_equals; +static PyObject *__pyx_n_s_NakedObject_type; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_python; +static PyObject *__pyx_kp_s_UTF_8; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s_XDict; +static PyObject *__pyx_n_s_XDict___add; +static PyObject *__pyx_n_s_XDict___eq; +static PyObject *__pyx_n_s_XDict___iadd; +static PyObject *__pyx_n_s_XDict___init; +static PyObject *__pyx_n_s_XDict___ne; +static PyObject *__pyx_n_s_XDict_conditional_map_to_vals; +static PyObject *__pyx_n_s_XDict_difference; +static PyObject *__pyx_n_s_XDict_equals; +static PyObject *__pyx_n_s_XDict_intersection; +static PyObject *__pyx_n_s_XDict_key_xlist; +static PyObject *__pyx_n_s_XDict_map_to_vals; +static PyObject *__pyx_n_s_XDict_max_val; +static PyObject *__pyx_n_s_XDict_min_val; +static PyObject *__pyx_n_s_XDict_random; +static PyObject *__pyx_n_s_XDict_random_sample; +static PyObject *__pyx_n_s_XDict_sum_vals; +static PyObject *__pyx_n_s_XDict_val_count; +static PyObject *__pyx_n_s_XDict_val_count_ci; +static PyObject *__pyx_n_s_XDict_val_xlist; +static PyObject *__pyx_n_s_XDict_xitems; +static PyObject *__pyx_n_s_XFSet; +static PyObject *__pyx_n_s_XFSet___new; +static PyObject *__pyx_n_s_XFSet__getAttributeDict; +static PyObject *__pyx_n_s_XFSet_type; +static PyObject *__pyx_n_s_XFSet_xlist; +static PyObject *__pyx_n_s_XFSet_xset; +static PyObject *__pyx_n_s_XList; +static PyObject *__pyx_n_s_XList___add; +static PyObject *__pyx_n_s_XList___eq; +static PyObject *__pyx_n_s_XList___iadd; +static PyObject *__pyx_n_s_XList___init; +static PyObject *__pyx_n_s_XList___ne; +static PyObject *__pyx_n_s_XList_conditional_map_to_items; +static PyObject *__pyx_n_s_XList_count_ci; +static PyObject *__pyx_n_s_XList_count_duplicates; +static PyObject *__pyx_n_s_XList_difference; +static PyObject *__pyx_n_s_XList_equals; +static PyObject *__pyx_n_s_XList_intersection; +static PyObject *__pyx_n_s_XList_join; +static PyObject *__pyx_n_s_XList_map_to_items; +static PyObject *__pyx_n_s_XList_max; +static PyObject *__pyx_n_s_XList_min; +static PyObject *__pyx_n_s_XList_multi_wildcard_match; +static PyObject *__pyx_n_s_XList_postfix; +static PyObject *__pyx_n_s_XList_prefix; +static PyObject *__pyx_n_s_XList_random; +static PyObject *__pyx_n_s_XList_random_sample; +static PyObject *__pyx_n_s_XList_remove_duplicates; +static PyObject *__pyx_n_s_XList_shuffle; +static PyObject *__pyx_n_s_XList_sum; +static PyObject *__pyx_n_s_XList_surround; +static PyObject *__pyx_n_s_XList_wildcard_match; +static PyObject *__pyx_n_s_XList_xfset; +static PyObject *__pyx_n_s_XList_xset; +static PyObject *__pyx_n_s_XList_xtuple; +static PyObject *__pyx_n_s_XMaxHeap; +static PyObject *__pyx_n_s_XMaxHeap___init; +static PyObject *__pyx_n_s_XMaxHeap___len; +static PyObject *__pyx_n_s_XMaxHeap_length; +static PyObject *__pyx_n_s_XMaxHeap_pop; +static PyObject *__pyx_n_s_XMaxHeap_push; +static PyObject *__pyx_n_s_XMaxHeap_pushpop; +static PyObject *__pyx_n_s_XMinHeap; +static PyObject *__pyx_n_s_XMinHeap___init; +static PyObject *__pyx_n_s_XMinHeap___len; +static PyObject *__pyx_n_s_XMinHeap_length; +static PyObject *__pyx_n_s_XMinHeap_pop; +static PyObject *__pyx_n_s_XMinHeap_push; +static PyObject *__pyx_n_s_XMinHeap_pushpop; +static PyObject *__pyx_n_s_XQueue; +static PyObject *__pyx_n_s_XQueue___init; +static PyObject *__pyx_n_s_XSet; +static PyObject *__pyx_n_s_XSet___iadd; +static PyObject *__pyx_n_s_XSet___init; +static PyObject *__pyx_n_s_XSet___lshift; +static PyObject *__pyx_n_s_XSet_xfset; +static PyObject *__pyx_n_s_XSet_xlist; +static PyObject *__pyx_n_s_XString; +static PyObject *__pyx_n_s_XString___new; +static PyObject *__pyx_n_s_XString__getAttributeDict; +static PyObject *__pyx_n_s_XString_begins; +static PyObject *__pyx_n_s_XString_concat; +static PyObject *__pyx_n_s_XString_contains; +static PyObject *__pyx_n_s_XString_ends; +static PyObject *__pyx_n_s_XString_type; +static PyObject *__pyx_n_s_XString_unicode; +static PyObject *__pyx_n_s_XString_wildcard_match; +static PyObject *__pyx_n_s_XString_xsplit; +static PyObject *__pyx_n_s_XString_xsplit_set; +static PyObject *__pyx_n_s_XTuple; +static PyObject *__pyx_n_s_XTuple___new; +static PyObject *__pyx_n_s_XTuple__getAttributeDict; +static PyObject *__pyx_n_s_XTuple_type; +static PyObject *__pyx_n_s_XUnicode; +static PyObject *__pyx_n_s_XUnicode2; +static PyObject *__pyx_n_s_XUnicode3; +static PyObject *__pyx_n_s_XUnicode_2; +static PyObject *__pyx_n_s_XUnicode_3; +static PyObject *__pyx_n_s_XUnicode___cmp; +static PyObject *__pyx_n_s_XUnicode___getattr; +static PyObject *__pyx_n_s_XUnicode___init; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod_2; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod_3; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod_4; +static PyObject *__pyx_n_s_XUnicode___repr; +static PyObject *__pyx_n_s_XUnicode___str; +static PyObject *__pyx_n_s_XUnicode__getAttributeDict; +static PyObject *__pyx_n_s_XUnicode_type; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_kp_s__9; +static PyObject *__pyx_n_s_add; +static PyObject *__pyx_n_s_after; +static PyObject *__pyx_n_s_another_dict; +static PyObject *__pyx_n_s_another_list; +static PyObject *__pyx_n_s_another_set; +static PyObject *__pyx_n_s_attr_dict; +static PyObject *__pyx_n_s_attributes; +static PyObject *__pyx_n_s_before; +static PyObject *__pyx_n_s_begin_string; +static PyObject *__pyx_n_s_begins; +static PyObject *__pyx_n_s_choice; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_cmp; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_concat; +static PyObject *__pyx_n_s_conditional_function; +static PyObject *__pyx_n_s_conditional_map_to_items; +static PyObject *__pyx_n_s_conditional_map_to_vals; +static PyObject *__pyx_n_s_contains; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_count_ci; +static PyObject *__pyx_n_s_count_duplicates; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_delim2; +static PyObject *__pyx_n_s_deque; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dict_obj; +static PyObject *__pyx_n_s_difference; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_end_string; +static PyObject *__pyx_n_s_ends; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_eq; +static PyObject *__pyx_n_s_equal_attributes; +static PyObject *__pyx_n_s_equal_type; +static PyObject *__pyx_n_s_equals; +static PyObject *__pyx_n_s_extend; +static PyObject *__pyx_n_s_first_list; +static PyObject *__pyx_n_s_fnmatch; +static PyObject *__pyx_n_s_fnmatchcase; +static PyObject *__pyx_n_s_getAttributeDict; +static PyObject *__pyx_n_s_getattr; +static PyObject *__pyx_n_s_heappop; +static PyObject *__pyx_n_s_heappush; +static PyObject *__pyx_n_s_heapq; +static PyObject *__pyx_n_s_iadd; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_index_2; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_initial_iterable; +static PyObject *__pyx_n_s_intersection; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_iteritems; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_key_xlist; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_types; +static PyObject *__pyx_n_s_list_obj; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_lshift; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_map_to_items; +static PyObject *__pyx_n_s_map_to_vals; +static PyObject *__pyx_n_s_mapped_function; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_max_length; +static PyObject *__pyx_n_s_max_val; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_min_val; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_multi_wildcard_match; +static PyObject *__pyx_n_s_naked_type; +static PyObject *__pyx_n_s_naked_type_2; +static PyObject *__pyx_n_s_naked_u_string; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_ne; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_new_dict; +static PyObject *__pyx_n_s_nkd_fnmatchcase; +static PyObject *__pyx_n_s_norm_text; +static PyObject *__pyx_n_s_norm_unicode; +static PyObject *__pyx_n_s_normalize; +static PyObject *__pyx_n_s_number_of_items; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_other_dict; +static PyObject *__pyx_n_s_other_lists; +static PyObject *__pyx_n_s_other_obj; +static PyObject *__pyx_n_s_other_string; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_postfix; +static PyObject *__pyx_n_s_prefix; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_push; +static PyObject *__pyx_n_s_pushpop; +static PyObject *__pyx_n_s_py_major_version; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_queue; +static PyObject *__pyx_n_s_random; +static PyObject *__pyx_n_s_random_key_list; +static PyObject *__pyx_n_s_random_sample; +static PyObject *__pyx_n_s_re; +static PyObject *__pyx_n_s_remove_duplicates; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_result_list; +static PyObject *__pyx_n_s_return_list; +static PyObject *__pyx_n_s_sample; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_separator; +static PyObject *__pyx_n_s_set_obj; +static PyObject *__pyx_n_s_shuffle; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_split_delimiter; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_str_list; +static PyObject *__pyx_n_s_str_obj; +static PyObject *__pyx_n_s_string_text; +static PyObject *__pyx_n_s_strings; +static PyObject *__pyx_n_s_subitem; +static PyObject *__pyx_n_s_substring; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_sum_vals; +static PyObject *__pyx_n_s_surround; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_temp_list; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_string; +static PyObject *__pyx_n_s_test_value; +static PyObject *__pyx_n_s_the_attribute; +static PyObject *__pyx_n_s_the_key; +static PyObject *__pyx_n_s_the_list; +static PyObject *__pyx_n_s_the_object; +static PyObject *__pyx_n_s_the_set; +static PyObject *__pyx_n_s_the_string_text; +static PyObject *__pyx_n_s_the_tuple; +static PyObject *__pyx_n_s_tup_obj; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_n_s_unicodedata; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_val_count; +static PyObject *__pyx_n_s_val_count_ci; +static PyObject *__pyx_n_s_val_xlist; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_value_name; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_wc; +static PyObject *__pyx_n_s_wc_list; +static PyObject *__pyx_n_s_wildcard; +static PyObject *__pyx_n_s_wildcard_match; +static PyObject *__pyx_n_s_wildcards; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xfset; +static PyObject *__pyx_n_s_xitems; +static PyObject *__pyx_n_s_xlist; +static PyObject *__pyx_n_s_xset; +static PyObject *__pyx_n_s_xsplit; +static PyObject *__pyx_n_s_xsplit_set; +static PyObject *__pyx_n_s_xtuple; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_10; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__109; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__113; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__117; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__121; +static PyObject *__pyx_tuple__123; +static PyObject *__pyx_tuple__125; +static PyObject *__pyx_tuple__127; +static PyObject *__pyx_tuple__129; +static PyObject *__pyx_tuple__131; +static PyObject *__pyx_tuple__133; +static PyObject *__pyx_tuple__135; +static PyObject *__pyx_tuple__137; +static PyObject *__pyx_tuple__139; +static PyObject *__pyx_tuple__141; +static PyObject *__pyx_tuple__143; +static PyObject *__pyx_tuple__145; +static PyObject *__pyx_tuple__147; +static PyObject *__pyx_tuple__149; +static PyObject *__pyx_tuple__151; +static PyObject *__pyx_tuple__153; +static PyObject *__pyx_tuple__155; +static PyObject *__pyx_tuple__157; +static PyObject *__pyx_tuple__159; +static PyObject *__pyx_tuple__161; +static PyObject *__pyx_tuple__163; +static PyObject *__pyx_tuple__165; +static PyObject *__pyx_tuple__167; +static PyObject *__pyx_tuple__169; +static PyObject *__pyx_tuple__171; +static PyObject *__pyx_tuple__173; +static PyObject *__pyx_tuple__175; +static PyObject *__pyx_tuple__177; +static PyObject *__pyx_tuple__179; +static PyObject *__pyx_tuple__181; +static PyObject *__pyx_tuple__183; +static PyObject *__pyx_tuple__185; +static PyObject *__pyx_tuple__187; +static PyObject *__pyx_tuple__189; +static PyObject *__pyx_tuple__191; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__197; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__96; +static PyObject *__pyx_codeobj__98; +static PyObject *__pyx_codeobj__100; +static PyObject *__pyx_codeobj__102; +static PyObject *__pyx_codeobj__104; +static PyObject *__pyx_codeobj__106; +static PyObject *__pyx_codeobj__108; +static PyObject *__pyx_codeobj__110; +static PyObject *__pyx_codeobj__112; +static PyObject *__pyx_codeobj__114; +static PyObject *__pyx_codeobj__116; +static PyObject *__pyx_codeobj__118; +static PyObject *__pyx_codeobj__120; +static PyObject *__pyx_codeobj__122; +static PyObject *__pyx_codeobj__124; +static PyObject *__pyx_codeobj__126; +static PyObject *__pyx_codeobj__128; +static PyObject *__pyx_codeobj__130; +static PyObject *__pyx_codeobj__132; +static PyObject *__pyx_codeobj__134; +static PyObject *__pyx_codeobj__136; +static PyObject *__pyx_codeobj__138; +static PyObject *__pyx_codeobj__140; +static PyObject *__pyx_codeobj__142; +static PyObject *__pyx_codeobj__144; +static PyObject *__pyx_codeobj__146; +static PyObject *__pyx_codeobj__148; +static PyObject *__pyx_codeobj__150; +static PyObject *__pyx_codeobj__152; +static PyObject *__pyx_codeobj__154; +static PyObject *__pyx_codeobj__156; +static PyObject *__pyx_codeobj__158; +static PyObject *__pyx_codeobj__160; +static PyObject *__pyx_codeobj__162; +static PyObject *__pyx_codeobj__164; +static PyObject *__pyx_codeobj__166; +static PyObject *__pyx_codeobj__168; +static PyObject *__pyx_codeobj__170; +static PyObject *__pyx_codeobj__172; +static PyObject *__pyx_codeobj__174; +static PyObject *__pyx_codeobj__176; +static PyObject *__pyx_codeobj__178; +static PyObject *__pyx_codeobj__180; +static PyObject *__pyx_codeobj__182; +static PyObject *__pyx_codeobj__184; +static PyObject *__pyx_codeobj__186; +static PyObject *__pyx_codeobj__188; +static PyObject *__pyx_codeobj__190; +static PyObject *__pyx_codeobj__192; +static PyObject *__pyx_codeobj__194; +static PyObject *__pyx_codeobj__196; +static PyObject *__pyx_codeobj__198; +static PyObject *__pyx_codeobj__200; +static PyObject *__pyx_codeobj__202; +static PyObject *__pyx_codeobj__204; +static PyObject *__pyx_codeobj__206; +static PyObject *__pyx_codeobj__208; +static PyObject *__pyx_codeobj__210; +static PyObject *__pyx_codeobj__212; +static PyObject *__pyx_codeobj__214; +static PyObject *__pyx_codeobj__216; +static PyObject *__pyx_codeobj__218; + +/* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_NakedObject)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_NakedObject)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_NakedObject)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[3] = {0,0,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_attributes; + values[2] = ((PyObject *)((PyObject*)__pyx_n_s_NakedObject)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_attributes = values[1]; + __pyx_v_naked_type = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject___init__(__pyx_self, __pyx_v_self, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":18 + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(self, key, attributes[key]) + */ + __pyx_t_1 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 > 0) != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":19 + * def __init__(self, attributes={}, naked_type='NakedObject'): + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(self, key, attributes[key]) + * setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":20 + * if len(attributes) > 0: + * for key in attributes: + * setattr(self, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + * + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":21 + * for key in attributes: + * setattr(self, key, attributes[key]) + * setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_6 = PyObject_SetAttr(__pyx_v_self, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":28 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type = {__Pyx_NAMESTR("_equal_type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_equal_type (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_equal_type", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_equal_type") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_equal_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_4_equal_type(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_4_equal_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_equal_type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":35 + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): + * return type(self) == type(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_self)), ((PyObject *)Py_TYPE(__pyx_v_other_obj)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes = {__Pyx_NAMESTR("_equal_attributes"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_equal_attributes (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_equal_attributes", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_equal_attributes") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_equal_attributes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_6_equal_attributes(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_6_equal_attributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_equal_attributes", 0); + + /* "lib/Naked/toolshed/c/types.pyx":42 + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): + * return self.__dict__ == other_obj.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":48 + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): + * return self.equals(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":54 + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): + * result = self.equals(other_obj) # <<<<<<<<<<<<<< + * if result: + * return False # reverse result of the equals method + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":55 + * def __ne__(self, other_obj): + * result = self.equals(other_obj) + * if result: # <<<<<<<<<<<<<< + * return False # reverse result of the equals method + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/types.pyx":56 + * result = self.equals(other_obj) + * if result: + * return False # reverse result of the equals method # <<<<<<<<<<<<<< + * else: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":58 + * return False # reverse result of the equals method + * else: + * return True # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals = {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_12equals(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_12equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":66 + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_attributes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_14type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_14type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":73 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":74 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":76 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XDict)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XDict)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XDict)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_dict_obj = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dict_obj,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XDict)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dict_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_dict_obj = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict___init__(__pyx_self, __pyx_v_self, __pyx_v_dict_obj, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dict_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":84 + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_dict_obj); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_dict_obj); + __Pyx_GIVEREF(__pyx_v_dict_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":85 + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__ = {__Pyx_NAMESTR("__add__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_2__add__(__pyx_self, __pyx_v_self, __pyx_v_other_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":97 + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): + * try: # <<<<<<<<<<<<<< + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":98 + * def __add__(self, other_dict): + * try: + * self.update(other_dict) # <<<<<<<<<<<<<< + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_other_dict); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_other_dict); + __Pyx_GIVEREF(__pyx_v_other_dict); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":99 + * try: + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): # <<<<<<<<<<<<<< + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + */ + __pyx_t_7 = PyObject_HasAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_XDict, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":100 + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_dict, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_attr_dict = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":101 + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_10 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = ((__pyx_t_10 > 0) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":102 + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * return self + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_5 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_11(__pyx_t_5); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":103 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_6 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/types.pyx":104 + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":105 + * setattr(self, key, attr_dict[key]) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/types.pyx":106 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":107 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/types.pyx":108 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__ = {__Pyx_NAMESTR("__iadd__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__iadd__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_4__iadd__(__pyx_self, __pyx_v_self, __pyx_v_other_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iadd__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":116 + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): + * try: # <<<<<<<<<<<<<< + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":117 + * def __iadd__(self, other_dict): + * try: + * self.update(other_dict) # <<<<<<<<<<<<<< + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_other_dict); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_other_dict); + __Pyx_GIVEREF(__pyx_v_other_dict); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":118 + * try: + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): # <<<<<<<<<<<<<< + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + */ + __pyx_t_7 = PyObject_HasAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_XDict, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":119 + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_dict, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_attr_dict = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":120 + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_10 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = ((__pyx_t_10 > 0) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":121 + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * return self + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_5 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_11(__pyx_t_5); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":122 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_6 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/types.pyx":123 + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":124 + * setattr(self, key, attr_dict[key]) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/types.pyx":125 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":126 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/types.pyx":127 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":133 + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): + * return self.equals(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_8__ne__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":139 + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): + * result = self.equals(other_obj) # <<<<<<<<<<<<<< + * if result: + * return False # reverse result of the equals method + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":140 + * def __ne__(self, other_obj): + * result = self.equals(other_obj) + * if result: # <<<<<<<<<<<<<< + * return False # reverse result of the equals method + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/types.pyx":141 + * result = self.equals(other_obj) + * if result: + * return False # reverse result of the equals method # <<<<<<<<<<<<<< + * else: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":143 + * return False # reverse result of the equals method + * else: + * return True # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals = {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_10equals(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":150 + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): # <<<<<<<<<<<<<< + * if dict(self) == dict(other_obj): + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":151 + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":152 + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":154 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":156 + * return False + * else: + * return False # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals = {__Pyx_NAMESTR("conditional_map_to_vals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_conditional_function = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("conditional_map_to_vals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_conditional_function,&__pyx_n_s_mapped_function,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_vals", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_vals", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conditional_map_to_vals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_conditional_function = values[1]; + __pyx_v_mapped_function = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("conditional_map_to_vals", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.conditional_map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_12conditional_map_to_vals(__pyx_self, __pyx_v_self, __pyx_v_conditional_function, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_12conditional_map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("conditional_map_to_vals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":168 + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): + * for key, value in self.xitems(): # <<<<<<<<<<<<<< + * if conditional_function(key): + * self[key] = mapped_function(value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xitems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":169 + * def conditional_map_to_vals(self, conditional_function, mapped_function): + * for key, value in self.xitems(): + * if conditional_function(key): # <<<<<<<<<<<<<< + * self[key] = mapped_function(value) + * return self + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_conditional_function, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":170 + * for key, value in self.xitems(): + * if conditional_function(key): + * self[key] = mapped_function(value) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_key, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7; + } + __pyx_L7:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":171 + * if conditional_function(key): + * self[key] = mapped_function(value) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.conditional_map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals = {__Pyx_NAMESTR("map_to_vals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_to_vals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mapped_function,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_to_vals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_to_vals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_mapped_function = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_to_vals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_14map_to_vals(__pyx_self, __pyx_v_self, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_14map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_to_vals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":180 + * def map_to_vals(self, mapped_function): + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): # <<<<<<<<<<<<<< + * self[key] = mapped_function(value) + * return self + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xitems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":181 + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + * self[key] = mapped_function(value) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_key, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":182 + * for key, value in self.xitems(): + * self[key] = mapped_function(value) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist = {__Pyx_NAMESTR("val_xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("val_xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_16val_xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_16val_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("val_xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":190 + * #------------------------------------------------------------------------------ + * def val_xlist(self): + * return XList(self.values(), self._getAttributeDict()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val = {__Pyx_NAMESTR("max_val"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max_val (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_18max_val(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_18max_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max_val", 0); + + /* "lib/Naked/toolshed/c/types.pyx":197 + * #------------------------------------------------------------------------------ + * def max_val(self): + * return max(zip(self.values(), self.keys())) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.max_val", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val = {__Pyx_NAMESTR("min_val"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("min_val (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_20min_val(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_20min_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("min_val", 0); + + /* "lib/Naked/toolshed/c/types.pyx":203 + * #------------------------------------------------------------------------------ + * def min_val(self): + * return min(zip(self.values(), self.keys())) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.min_val", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals = {__Pyx_NAMESTR("sum_vals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sum_vals (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_22sum_vals(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_22sum_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sum_vals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":210 + * #------------------------------------------------------------------------------ + * def sum_vals(self): + * return sum(self.values()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.sum_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count = {__Pyx_NAMESTR("val_count"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("val_count (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("val_count", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "val_count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_value_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("val_count", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_24val_count(__pyx_self, __pyx_v_self, __pyx_v_value_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_24val_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name) { + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_test_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("val_count", 0); + + /* "lib/Naked/toolshed/c/types.pyx":219 + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): + * count = 0 # <<<<<<<<<<<<<< + * for test_value in self.values(): + * if value_name == test_value: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_count = __pyx_int_0; + + /* "lib/Naked/toolshed/c/types.pyx":220 + * def val_count(self, value_name): + * count = 0 + * for test_value in self.values(): # <<<<<<<<<<<<<< + * if value_name == test_value: + * count += 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_test_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":221 + * count = 0 + * for test_value in self.values(): + * if value_name == test_value: # <<<<<<<<<<<<<< + * count += 1 + * return count + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_value_name, __pyx_v_test_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":222 + * for test_value in self.values(): + * if value_name == test_value: + * count += 1 # <<<<<<<<<<<<<< + * return count + * + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":223 + * if value_name == test_value: + * count += 1 + * return count # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_count); + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_test_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci = {__Pyx_NAMESTR("val_count_ci"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("val_count_ci (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("val_count_ci", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "val_count_ci") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_value_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("val_count_ci", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_26val_count_ci(__pyx_self, __pyx_v_self, __pyx_v_value_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_26val_count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name) { + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_test_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("val_count_ci", 0); + + /* "lib/Naked/toolshed/c/types.pyx":232 + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): + * count = 0 # <<<<<<<<<<<<<< + * for test_value in self.values(): + * try: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_count = __pyx_int_0; + + /* "lib/Naked/toolshed/c/types.pyx":233 + * def val_count_ci(self, value_name): + * count = 0 + * for test_value in self.values(): # <<<<<<<<<<<<<< + * try: + * if value_name.lower() in test_value.lower(): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_test_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":234 + * count = 0 + * for test_value in self.values(): + * try: # <<<<<<<<<<<<<< + * if value_name.lower() in test_value.lower(): + * count += 1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":235 + * for test_value in self.values(): + * try: + * if value_name.lower() in test_value.lower(): # <<<<<<<<<<<<<< + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_test_value, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/types.pyx":236 + * try: + * if value_name.lower() in test_value.lower(): + * count += 1 # <<<<<<<<<<<<<< + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + */ + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":237 + * if value_name.lower() in test_value.lower(): + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt # <<<<<<<<<<<<<< + * continue + * return count + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/types.pyx":238 + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue # <<<<<<<<<<<<<< + * return count + * + */ + goto __pyx_L15_except_continue; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L6_exception_handled; + __pyx_L15_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L11_try_continue; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L11_try_continue:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L3_continue; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L12_try_end:; + } + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":239 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + * return count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_count); + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_test_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference = {__Pyx_NAMESTR("difference"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("difference (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_28difference(__pyx_self, __pyx_v_self, __pyx_v_another_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_28difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("difference", 0); + + /* "lib/Naked/toolshed/c/types.pyx":251 + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): + * return set(self.keys()) - set(another_dict.keys()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_another_dict, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection = {__Pyx_NAMESTR("intersection"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersection (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_30intersection(__pyx_self, __pyx_v_self, __pyx_v_another_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_30intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersection", 0); + + /* "lib/Naked/toolshed/c/types.pyx":259 + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): + * return set(self.keys()) & set(another_dict.keys()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_another_dict, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist = {__Pyx_NAMESTR("key_xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("key_xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_32key_xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_32key_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("key_xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":267 + * #------------------------------------------------------------------------------ + * def key_xlist(self): + * return XList(self.keys(), self._getAttributeDict()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.key_xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_35random(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_35random = {__Pyx_NAMESTR("random"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_35random, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_35random(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_34random(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_34random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_random = NULL; + CYTHON_UNUSED PyObject *__pyx_v_py_major_version = NULL; + PyObject *__pyx_v_random_key_list = NULL; + PyObject *__pyx_v_the_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random", 0); + + /* "lib/Naked/toolshed/c/types.pyx":275 + * #------------------------------------------------------------------------------ + * def random(self): + * import random # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * random_key_list = random.sample(self.keys(), 1) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":276 + * def random(self): + * import random + * from Naked.toolshed.python import py_major_version # <<<<<<<<<<<<<< + * random_key_list = random.sample(self.keys(), 1) + * the_key = random_key_list[0] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_py_major_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_py_major_version); + __Pyx_GIVEREF(__pyx_n_s_py_major_version); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_python, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_py_major_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_py_major_version = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":277 + * import random + * from Naked.toolshed.python import py_major_version + * random_key_list = random.sample(self.keys(), 1) # <<<<<<<<<<<<<< + * the_key = random_key_list[0] + * return {the_key: self[the_key]} + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_sample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_random_key_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":278 + * from Naked.toolshed.python import py_major_version + * random_key_list = random.sample(self.keys(), 1) + * the_key = random_key_list[0] # <<<<<<<<<<<<<< + * return {the_key: self[the_key]} + * + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_random_key_list, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_the_key = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":279 + * random_key_list = random.sample(self.keys(), 1) + * the_key = random_key_list[0] + * return {the_key: self[the_key]} # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_the_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_v_the_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.random", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XDECREF(__pyx_v_py_major_version); + __Pyx_XDECREF(__pyx_v_random_key_list); + __Pyx_XDECREF(__pyx_v_the_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample = {__Pyx_NAMESTR("random_sample"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_number_of_items = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random_sample (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_number_of_items,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number_of_items)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_sample") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_number_of_items = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_36random_sample(__pyx_self, __pyx_v_self, __pyx_v_number_of_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_36random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_v_random_key_list = NULL; + PyObject *__pyx_v_new_dict = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random_sample", 0); + + /* "lib/Naked/toolshed/c/types.pyx":287 + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): + * import random # <<<<<<<<<<<<<< + * random_key_list = random.sample(self.keys(), number_of_items) + * new_dict = {} + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":288 + * def random_sample(self, number_of_items): + * import random + * random_key_list = random.sample(self.keys(), number_of_items) # <<<<<<<<<<<<<< + * new_dict = {} + * for item in random_key_list: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_number_of_items); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_number_of_items); + __Pyx_GIVEREF(__pyx_v_number_of_items); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_random_key_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":289 + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + * new_dict = {} # <<<<<<<<<<<<<< + * for item in random_key_list: + * new_dict[item] = self[item] + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_new_dict = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":290 + * random_key_list = random.sample(self.keys(), number_of_items) + * new_dict = {} + * for item in random_key_list: # <<<<<<<<<<<<<< + * new_dict[item] = self[item] + * return new_dict + */ + if (PyList_CheckExact(__pyx_v_random_key_list) || PyTuple_CheckExact(__pyx_v_random_key_list)) { + __pyx_t_3 = __pyx_v_random_key_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_random_key_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":291 + * new_dict = {} + * for item in random_key_list: + * new_dict[item] = self[item] # <<<<<<<<<<<<<< + * return new_dict + * + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_self, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_v_new_dict, __pyx_v_item, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":292 + * for item in random_key_list: + * new_dict[item] = self[item] + * return new_dict # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_new_dict); + __pyx_r = __pyx_v_new_dict; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XDECREF(__pyx_v_random_key_list); + __Pyx_XDECREF(__pyx_v_new_dict); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems = {__Pyx_NAMESTR("xitems"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xitems (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_38xitems(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_38xitems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_py_major_version = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xitems", 0); + + /* "lib/Naked/toolshed/c/types.pyx":301 + * #------------------------------------------------------------------------------ + * def xitems(self): + * from Naked.toolshed.python import py_major_version # <<<<<<<<<<<<<< + * if py_major_version() > 2: + * return self.items() + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_py_major_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_py_major_version); + __Pyx_GIVEREF(__pyx_n_s_py_major_version); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_python, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_py_major_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_py_major_version = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":302 + * def xitems(self): + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: # <<<<<<<<<<<<<< + * return self.items() + * else: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_py_major_version, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/types.pyx":303 + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + * return self.items() # <<<<<<<<<<<<<< + * else: + * return self.iteritems() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":305 + * return self.items() + * else: + * return self.iteritems() # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.xitems", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_py_major_version); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XList)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XList)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XList)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_list_obj = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_list_obj,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XList)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_list_obj = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList___init__(__pyx_self, __pyx_v_self, __pyx_v_list_obj, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":313 + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_list_obj); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_list_obj); + __Pyx_GIVEREF(__pyx_v_list_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":314 + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__ = {__Pyx_NAMESTR("__add__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_lists = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_other_lists = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_other_lists)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_other_lists); + } else { + __pyx_v_other_lists = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__add__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__add__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_other_lists); __pyx_v_other_lists = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_2__add__(__pyx_self, __pyx_v_self, __pyx_v_other_lists); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_other_lists); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_lists) { + PyObject *__pyx_v_the_list = NULL; + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":325 + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): + * try: # <<<<<<<<<<<<<< + * for the_list in other_lists: + * # add attributes if it is an XList + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":326 + * def __add__(self, *other_lists): + * try: + * for the_list in other_lists: # <<<<<<<<<<<<<< + * # add attributes if it is an XList + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + */ + __pyx_t_4 = __pyx_v_other_lists; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + for (;;) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_the_list, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":328 + * for the_list in other_lists: + * # add attributes if it is an XList + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): # <<<<<<<<<<<<<< + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + */ + __pyx_t_7 = PyObject_HasAttr(__pyx_v_the_list, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_the_list, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_XList, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":329 + * # add attributes if it is an XList + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_the_list, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_attr_dict, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":330 + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = ((__pyx_t_11 > 0) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":331 + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * # extend the XList items + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_10 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + for (;;) { + if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_12(__pyx_t_10); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":332 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * # extend the XList items + * self.extend(the_list) + */ + __pyx_t_6 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/types.pyx":334 + * setattr(self, key, attr_dict[key]) + * # extend the XList items + * self.extend(the_list) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_the_list); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_the_list); + __Pyx_GIVEREF(__pyx_v_the_list); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":335 + * # extend the XList items + * self.extend(the_list) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":336 + * self.extend(the_list) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_14, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_14); + __pyx_v_e = __pyx_t_14; + + /* "lib/Naked/toolshed/c/types.pyx":337 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":338 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "lib/Naked/toolshed/c/types.pyx":339 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_the_list); + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__ = {__Pyx_NAMESTR("__iadd__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_list = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_list,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__iadd__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_list = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_4__iadd__(__pyx_self, __pyx_v_self, __pyx_v_another_list); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iadd__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":346 + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): + * try: # <<<<<<<<<<<<<< + * #add attributes if it is an XList + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":348 + * try: + * #add attributes if it is an XList + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): # <<<<<<<<<<<<<< + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + */ + __pyx_t_4 = PyObject_HasAttr(__pyx_v_another_list, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __pyx_t_5 = __Pyx_GetAttr(__pyx_v_another_list, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_XList, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_4; + } + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":349 + * #add attributes if it is an XList + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_another_list, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_attr_dict = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":350 + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_9 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = ((__pyx_t_9 > 0) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":351 + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * # extend the XList items + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_8 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_10(__pyx_t_8); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":352 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * # extend the XList items + * self.extend(another_list) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/types.pyx":354 + * setattr(self, key, attr_dict[key]) + * # extend the XList items + * self.extend(another_list) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_another_list); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_another_list); + __Pyx_GIVEREF(__pyx_v_another_list); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":355 + * # extend the XList items + * self.extend(another_list) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":356 + * self.extend(another_list) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/types.pyx":357 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":358 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/types.pyx":359 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":365 + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): + * return self.equals(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_8__ne__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":371 + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): + * result = self.equals(other_obj) # <<<<<<<<<<<<<< + * if result: + * return False # reverse result of the equals method + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":372 + * def __ne__(self, other_obj): + * result = self.equals(other_obj) + * if result: # <<<<<<<<<<<<<< + * return False # reverse result of the equals method + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/types.pyx":373 + * result = self.equals(other_obj) + * if result: + * return False # reverse result of the equals method # <<<<<<<<<<<<<< + * else: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":375 + * return False # reverse result of the equals method + * else: + * return True # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_11equals = {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_11equals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_10equals(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":382 + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): # <<<<<<<<<<<<<< + * if list(self) == list(other_obj): + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":383 + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":384 + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":386 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":388 + * return False + * else: + * return False # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_13join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_13join = {__Pyx_NAMESTR("join"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_13join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_13join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_separator = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_separator,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s__5)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_separator); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_separator = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("join", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_12join(__pyx_self, __pyx_v_self, __pyx_v_separator); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_12join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_separator) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("join", 0); + + /* "lib/Naked/toolshed/c/types.pyx":403 + * #------------------------------------------------------------------------------ + * def join(self, separator=""): + * return separator.join(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_separator, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix = {__Pyx_NAMESTR("postfix"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_after = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("postfix (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_after,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("postfix", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "postfix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_after = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("postfix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.postfix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_14postfix(__pyx_self, __pyx_v_self, __pyx_v_after); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_14postfix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_after) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("postfix", 0); + + /* "lib/Naked/toolshed/c/types.pyx":410 + * #------------------------------------------------------------------------------ + * def postfix(self, after): + * return [ "".join([x, after]) for x in self ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_x); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_after); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_after); + __Pyx_GIVEREF(__pyx_v_after); + __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.postfix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix = {__Pyx_NAMESTR("prefix"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_before = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("prefix (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_before,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_before)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("prefix", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prefix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_before = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("prefix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.prefix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_16prefix(__pyx_self, __pyx_v_self, __pyx_v_before); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_16prefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("prefix", 0); + + /* "lib/Naked/toolshed/c/types.pyx":417 + * #------------------------------------------------------------------------------ + * def prefix(self, before): + * return [ "".join([before, x]) for x in self ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_before); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_before); + __Pyx_GIVEREF(__pyx_v_before); + __Pyx_INCREF(__pyx_v_x); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.prefix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_19surround(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_19surround = {__Pyx_NAMESTR("surround"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_19surround, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_19surround(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_before = 0; + PyObject *__pyx_v_after = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("surround (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_before,&__pyx_n_s_after,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s__5)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_before)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("surround", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "surround") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_before = values[1]; + __pyx_v_after = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("surround", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.surround", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_18surround(__pyx_self, __pyx_v_self, __pyx_v_before, __pyx_v_after); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_18surround(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before, PyObject *__pyx_v_after) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("surround", 0); + __Pyx_INCREF(__pyx_v_after); + + /* "lib/Naked/toolshed/c/types.pyx":424 + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): + * if after == "": # <<<<<<<<<<<<<< + * after = before + * return [ "".join([before, x, after]) for x in self ] + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_after, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "lib/Naked/toolshed/c/types.pyx":425 + * def surround(self, before, after=""): + * if after == "": + * after = before # <<<<<<<<<<<<<< + * return [ "".join([before, x, after]) for x in self ] + * + */ + __Pyx_INCREF(__pyx_v_before); + __Pyx_DECREF_SET(__pyx_v_after, __pyx_v_before); + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":426 + * if after == "": + * after = before + * return [ "".join([before, x, after]) for x in self ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_3 = __pyx_v_self; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_before); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_before); + __Pyx_GIVEREF(__pyx_v_before); + __Pyx_INCREF(__pyx_v_x); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_after); + PyList_SET_ITEM(__pyx_t_6, 2, __pyx_v_after); + __Pyx_GIVEREF(__pyx_v_after); + __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.surround", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_after); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_21max(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_21max = {__Pyx_NAMESTR("max"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_21max, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_21max(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_20max(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_20max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max", 0); + + /* "lib/Naked/toolshed/c/types.pyx":435 + * #------------------------------------------------------------------------------ + * def max(self): + * return max(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_23min(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_23min = {__Pyx_NAMESTR("min"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_23min, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_23min(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("min (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_22min(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_22min(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("min", 0); + + /* "lib/Naked/toolshed/c/types.pyx":442 + * #------------------------------------------------------------------------------ + * def min(self): + * return min(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_25sum(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_25sum = {__Pyx_NAMESTR("sum"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_25sum, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_25sum(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sum (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_24sum(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_24sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sum", 0); + + /* "lib/Naked/toolshed/c/types.pyx":449 + * #------------------------------------------------------------------------------ + * def sum(self): + * return sum(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates = {__Pyx_NAMESTR("count_duplicates"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_duplicates (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_26count_duplicates(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_26count_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_duplicates", 0); + + /* "lib/Naked/toolshed/c/types.pyx":459 + * #------------------------------------------------------------------------------ + * def count_duplicates(self): + * return len(self) - len(set(self)) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_1 - __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates = {__Pyx_NAMESTR("remove_duplicates"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove_duplicates (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_28remove_duplicates(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_28remove_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove_duplicates", 0); + + /* "lib/Naked/toolshed/c/types.pyx":466 + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): + * return XList( set(self), self._getAttributeDict() ) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.remove_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_31difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_31difference = {__Pyx_NAMESTR("difference"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_31difference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_31difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_list = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("difference (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_list,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_list = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_30difference(__pyx_self, __pyx_v_self, __pyx_v_another_list); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_30difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("difference", 0); + + /* "lib/Naked/toolshed/c/types.pyx":473 + * #------------------------------------------------------------------------------ + * def difference(self, another_list): + * return set(self) - set(another_list) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_another_list); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_another_list); + __Pyx_GIVEREF(__pyx_v_another_list); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection = {__Pyx_NAMESTR("intersection"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_list = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersection (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_list,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_list = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_32intersection(__pyx_self, __pyx_v_self, __pyx_v_another_list); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_32intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersection", 0); + + /* "lib/Naked/toolshed/c/types.pyx":480 + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): + * return set(self) & set(another_list) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_another_list); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_another_list); + __Pyx_GIVEREF(__pyx_v_another_list); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items = {__Pyx_NAMESTR("map_to_items"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_to_items (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mapped_function,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_to_items", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_to_items") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_mapped_function = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_to_items", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_34map_to_items(__pyx_self, __pyx_v_self, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_34map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_to_items", 0); + + /* "lib/Naked/toolshed/c/types.pyx":491 + * def map_to_items(self, mapped_function): + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): # <<<<<<<<<<<<<< + * self[index] = mapped_function(item) + * return self + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_1); + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":492 + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + * self[index] = mapped_function(item) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_index, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":493 + * for index, item in enumerate(self): + * self[index] = mapped_function(item) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items = {__Pyx_NAMESTR("conditional_map_to_items"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_conditional_function = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("conditional_map_to_items (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_conditional_function,&__pyx_n_s_mapped_function,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_items", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_items", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conditional_map_to_items") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_conditional_function = values[1]; + __pyx_v_mapped_function = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("conditional_map_to_items", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.conditional_map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_36conditional_map_to_items(__pyx_self, __pyx_v_self, __pyx_v_conditional_function, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_36conditional_map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("conditional_map_to_items", 0); + + /* "lib/Naked/toolshed/c/types.pyx":501 + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): + * for index, item in enumerate(self): # <<<<<<<<<<<<<< + * if conditional_function(item): + * self[index] = mapped_function(item) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_1); + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":502 + * def conditional_map_to_items(self, conditional_function, mapped_function): + * for index, item in enumerate(self): + * if conditional_function(item): # <<<<<<<<<<<<<< + * self[index] = mapped_function(item) + * return self + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_conditional_function, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":503 + * for index, item in enumerate(self): + * if conditional_function(item): + * self[index] = mapped_function(item) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_index, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":504 + * if conditional_function(item): + * self[index] = mapped_function(item) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.conditional_map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci = {__Pyx_NAMESTR("count_ci"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_test_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_ci (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_test_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_ci", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_ci") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_test_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count_ci", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_38count_ci(__pyx_self, __pyx_v_self, __pyx_v_test_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_38count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_test_string) { + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_ci", 0); + + /* "lib/Naked/toolshed/c/types.pyx":514 + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): + * count = 0 # <<<<<<<<<<<<<< + * for item in self: + * try: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_count = __pyx_int_0; + + /* "lib/Naked/toolshed/c/types.pyx":515 + * def count_ci(self, test_string): + * count = 0 + * for item in self: # <<<<<<<<<<<<<< + * try: + * if test_string.lower() in item.lower(): + */ + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":516 + * count = 0 + * for item in self: + * try: # <<<<<<<<<<<<<< + * if test_string.lower() in item.lower(): + * count += 1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":517 + * for item in self: + * try: + * if test_string.lower() in item.lower(): # <<<<<<<<<<<<<< + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_test_string, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/types.pyx":518 + * try: + * if test_string.lower() in item.lower(): + * count += 1 # <<<<<<<<<<<<<< + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + */ + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":519 + * if test_string.lower() in item.lower(): + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt # <<<<<<<<<<<<<< + * continue + * return count + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/types.pyx":520 + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue # <<<<<<<<<<<<<< + * return count + * + */ + goto __pyx_L15_except_continue; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_exception_handled; + __pyx_L15_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_continue; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L11_try_continue:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L3_continue; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L12_try_end:; + } + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":521 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + * return count # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_count); + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_41random(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_41random = {__Pyx_NAMESTR("random"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_41random, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_41random(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_40random(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_40random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random", 0); + + /* "lib/Naked/toolshed/c/types.pyx":528 + * #------------------------------------------------------------------------------ + * def random(self): + * import random # <<<<<<<<<<<<<< + * return random.choice(self) + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":529 + * def random(self): + * import random + * return random.choice(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_choice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.random", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample = {__Pyx_NAMESTR("random_sample"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_number_of_items = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random_sample (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_number_of_items,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number_of_items)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_sample") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_number_of_items = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_42random_sample(__pyx_self, __pyx_v_self, __pyx_v_number_of_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_42random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random_sample", 0); + + /* "lib/Naked/toolshed/c/types.pyx":537 + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): + * import random # <<<<<<<<<<<<<< + * return random.sample(self, number_of_items) + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":538 + * def random_sample(self, number_of_items): + * import random + * return random.sample(self, number_of_items) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_number_of_items); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_number_of_items); + __Pyx_GIVEREF(__pyx_v_number_of_items); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle = {__Pyx_NAMESTR("shuffle"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("shuffle (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_44shuffle(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_44shuffle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("shuffle", 0); + + /* "lib/Naked/toolshed/c/types.pyx":545 + * #------------------------------------------------------------------------------ + * def shuffle(self): + * import random # <<<<<<<<<<<<<< + * random.shuffle(self) + * return self + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":546 + * def shuffle(self): + * import random + * random.shuffle(self) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":547 + * import random + * random.shuffle(self) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match = {__Pyx_NAMESTR("wildcard_match"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_wildcard = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wildcard_match (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wildcard,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wildcard)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wildcard_match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_wildcard = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_46wildcard_match(__pyx_self, __pyx_v_self, __pyx_v_wildcard); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_46wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard) { + PyObject *__pyx_v_fnmatchcase = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wildcard_match", 0); + + /* "lib/Naked/toolshed/c/types.pyx":557 + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): + * if hasattr(self, 'nkd_fnmatchcase'): # <<<<<<<<<<<<<< + * fnmatchcase = self.nkd_fnmatchcase + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":558 + * def wildcard_match(self, wildcard): + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase # <<<<<<<<<<<<<< + * else: + * from fnmatch import fnmatchcase + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":560 + * fnmatchcase = self.nkd_fnmatchcase + * else: + * from fnmatch import fnmatchcase # <<<<<<<<<<<<<< + * self.nkd_fnmatchcase = fnmatchcase + * return [ x for x in self if fnmatchcase(x, wildcard) ] + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_fnmatchcase); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_fnmatchcase); + __Pyx_GIVEREF(__pyx_n_s_fnmatchcase); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_fnmatch, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":561 + * else: + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase # <<<<<<<<<<<<<< + * return [ x for x in self if fnmatchcase(x, wildcard) ] + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase, __pyx_v_fnmatchcase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":562 + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase + * return [ x for x in self if fnmatchcase(x, wildcard) ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_3 = __pyx_v_self; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_wildcard); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_wildcard); + __Pyx_GIVEREF(__pyx_v_wildcard); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_fnmatchcase, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fnmatchcase); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match = {__Pyx_NAMESTR("multi_wildcard_match"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_wildcards = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("multi_wildcard_match (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wildcards,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wildcards)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("multi_wildcard_match", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multi_wildcard_match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_wildcards = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("multi_wildcard_match", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.multi_wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_48multi_wildcard_match(__pyx_self, __pyx_v_self, __pyx_v_wildcards); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_48multi_wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcards) { + PyObject *__pyx_v_fnmatchcase = NULL; + PyObject *__pyx_v_wc_list = NULL; + PyObject *__pyx_v_return_list = NULL; + PyObject *__pyx_v_wc = NULL; + PyObject *__pyx_v_temp_list = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("multi_wildcard_match", 0); + + /* "lib/Naked/toolshed/c/types.pyx":569 + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): + * if hasattr(self, 'nkd_fnmatchcase'): # <<<<<<<<<<<<<< + * fnmatchcase = self.nkd_fnmatchcase + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":570 + * def multi_wildcard_match(self, wildcards): + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase # <<<<<<<<<<<<<< + * else: + * from fnmatch import fnmatchcase + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":572 + * fnmatchcase = self.nkd_fnmatchcase + * else: + * from fnmatch import fnmatchcase # <<<<<<<<<<<<<< + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_fnmatchcase); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_fnmatchcase); + __Pyx_GIVEREF(__pyx_n_s_fnmatchcase); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_fnmatch, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":573 + * else: + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase # <<<<<<<<<<<<<< + * wc_list = wildcards.split('|') + * return_list = [] + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase, __pyx_v_fnmatchcase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":574 + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') # <<<<<<<<<<<<<< + * return_list = [] + * for wc in wc_list: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_wildcards, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_wc_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":575 + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') + * return_list = [] # <<<<<<<<<<<<<< + * for wc in wc_list: + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_return_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":576 + * wc_list = wildcards.split('|') + * return_list = [] + * for wc in wc_list: # <<<<<<<<<<<<<< + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + * for result in temp_list: + */ + if (PyList_CheckExact(__pyx_v_wc_list) || PyTuple_CheckExact(__pyx_v_wc_list)) { + __pyx_t_3 = __pyx_v_wc_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_wc_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_wc, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":577 + * return_list = [] + * for wc in wc_list: + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] # <<<<<<<<<<<<<< + * for result in temp_list: + * return_list.append(result) + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_7 = __pyx_v_self; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; + } + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_7)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_7)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_10 = __pyx_t_9(__pyx_t_7); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_wc); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_wc); + __Pyx_GIVEREF(__pyx_v_wc); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_fnmatchcase, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_2) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_temp_list, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":578 + * for wc in wc_list: + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + * for result in temp_list: # <<<<<<<<<<<<<< + * return_list.append(result) + * return return_list + */ + __pyx_t_4 = __pyx_v_temp_list; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + for (;;) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":579 + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + * for result in temp_list: + * return_list.append(result) # <<<<<<<<<<<<<< + * return return_list + * + */ + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_return_list, __pyx_v_result); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":580 + * for result in temp_list: + * return_list.append(result) + * return return_list # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_return_list); + __pyx_r = __pyx_v_return_list; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.multi_wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fnmatchcase); + __Pyx_XDECREF(__pyx_v_wc_list); + __Pyx_XDECREF(__pyx_v_return_list); + __Pyx_XDECREF(__pyx_v_wc); + __Pyx_XDECREF(__pyx_v_temp_list); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_51xset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_51xset = {__Pyx_NAMESTR("xset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_51xset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_51xset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_50xset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_50xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":590 + * #------------------------------------------------------------------------------ + * def xset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XSet(set(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":591 + * def xset(self): + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset = {__Pyx_NAMESTR("xfset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xfset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_52xfset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_52xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xfset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":598 + * #------------------------------------------------------------------------------ + * def xfset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XFSet(set(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":599 + * def xfset(self): + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XFSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple = {__Pyx_NAMESTR("xtuple"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xtuple (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_54xtuple(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_54xtuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xtuple", 0); + + /* "lib/Naked/toolshed/c/types.pyx":606 + * #------------------------------------------------------------------------------ + * def xtuple(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XTuple(tuple(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":607 + * def xtuple(self): + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XTuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.xtuple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XMaxHeap)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XMaxHeap)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XMaxHeap)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[3] = {0,0,0}; + __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_attributes; + values[2] = ((PyObject *)((PyObject*)__pyx_n_s_XMaxHeap)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_attributes = values[1]; + __pyx_v_naked_type = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap___init__(__pyx_self, __pyx_v_self, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":616 + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * self._queue = [] + * self._index = 0 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":617 + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] # <<<<<<<<<<<<<< + * self._index = 0 + * + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_queue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":618 + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + * self._index = 0 # <<<<<<<<<<<<<< + * + * # length of the queue + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__ = {__Pyx_NAMESTR("__len__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_2__len__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":622 + * # length of the queue + * def __len__(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push = {__Pyx_NAMESTR("push"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("push (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_4push(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("push", 0); + + /* "lib/Naked/toolshed/c/types.pyx":626 + * # O(log n) complexity + * def push(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Negative(__pyx_v_priority); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":627 + * def push(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop = {__Pyx_NAMESTR("pop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pop (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_6pop(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":631 + * # O(log n) complexity + * def pop(self): + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":632 + * def pop(self): + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":634 + * return heappop(self._queue)[-1] + * else: + * return None # <<<<<<<<<<<<<< + * + * # push new object and return the highest priority object + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop = {__Pyx_NAMESTR("pushpop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pushpop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushpop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_8pushpop(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pushpop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":638 + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * if self._queue: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Negative(__pyx_v_priority); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":639 + * def pushpop(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":640 + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":641 + * self._index += 1 + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None # return None if the queue is empty + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":643 + * return heappop(self._queue)[-1] + * else: + * return None # return None if the queue is empty # <<<<<<<<<<<<<< + * + * # the length of the queue + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length = {__Pyx_NAMESTR("length"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("length (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_10length(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("length", 0); + + /* "lib/Naked/toolshed/c/types.pyx":647 + * # the length of the queue + * def length(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XMinHeap)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XMinHeap)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XMinHeap)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[3] = {0,0,0}; + __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_attributes; + values[2] = ((PyObject *)((PyObject*)__pyx_n_s_XMinHeap)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_attributes = values[1]; + __pyx_v_naked_type = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap___init__(__pyx_self, __pyx_v_self, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":656 + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * self._queue = [] + * self._index = 0 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":657 + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] # <<<<<<<<<<<<<< + * self._index = 0 + * + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_queue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":658 + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + * self._index = 0 # <<<<<<<<<<<<<< + * + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__ = {__Pyx_NAMESTR("__len__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_2__len__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":663 + * # length of the queue + * def __len__(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push = {__Pyx_NAMESTR("push"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("push (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_4push(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("push", 0); + + /* "lib/Naked/toolshed/c/types.pyx":667 + * # O(log n) complexity + * def push(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":668 + * def push(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop = {__Pyx_NAMESTR("pop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pop (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_6pop(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":672 + * # O(log n) complexity + * def pop(self): + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":673 + * def pop(self): + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None # return None if the queue is empty + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":675 + * return heappop(self._queue)[-1] + * else: + * return None # return None if the queue is empty # <<<<<<<<<<<<<< + * + * # push new object and return the lowest priority object + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop = {__Pyx_NAMESTR("pushpop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pushpop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushpop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_8pushpop(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pushpop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":679 + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * if self._queue: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":680 + * def pushpop(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":681 + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":682 + * self._index += 1 + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None #return None if the queue is empty + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":684 + * return heappop(self._queue)[-1] + * else: + * return None #return None if the queue is empty # <<<<<<<<<<<<<< + * + * # the length of the queue + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length = {__Pyx_NAMESTR("length"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("length (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_10length(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("length", 0); + + /* "lib/Naked/toolshed/c/types.pyx":688 + * # the length of the queue + * def length(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_initial_iterable); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_initial_iterable); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_initial_iterable); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject *)__pyx_int_10)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_int_10)); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XQueue)); + PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject*)__pyx_n_s_XQueue)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XQueue)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XQueue.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_initial_iterable = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_max_length = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_initial_iterable,&__pyx_n_s_attributes,&__pyx_n_s_max_length,&__pyx_n_s_naked_type,0}; + PyObject* values[5] = {0,0,0,0,0}; + __pyx_defaults5 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_initial_iterable; + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject *)__pyx_int_10)); + values[4] = ((PyObject *)((PyObject*)__pyx_n_s_XQueue)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_initial_iterable); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_length); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_initial_iterable = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_max_length = values[3]; + __pyx_v_naked_type = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue___init__(__pyx_self, __pyx_v_self, __pyx_v_initial_iterable, __pyx_v_attributes, __pyx_v_max_length, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_initial_iterable, PyObject *__pyx_v_attributes, PyObject *__pyx_v_max_length, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":698 + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_deque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_initial_iterable); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_initial_iterable); + __Pyx_GIVEREF(__pyx_v_initial_iterable); + __Pyx_INCREF(__pyx_v_max_length); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_max_length); + __Pyx_GIVEREF(__pyx_v_max_length); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":699 + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XSet)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XSet)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XSet)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_set_obj = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set_obj,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults6 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XSet)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_set_obj = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet___init__(__pyx_self, __pyx_v_self, __pyx_v_set_obj, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":709 + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_set_obj); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_set_obj); + __Pyx_GIVEREF(__pyx_v_set_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":710 + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * # << operator is overloaded to extend the XSet with a second set + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__ = {__Pyx_NAMESTR("__lshift__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_set = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_set,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_set)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__lshift__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__lshift__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_set = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__lshift__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_2__lshift__(__pyx_self, __pyx_v_self, __pyx_v_another_set); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_2__lshift__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__lshift__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":714 + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): + * self.update(another_set) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_another_set); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_another_set); + __Pyx_GIVEREF(__pyx_v_another_set); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":715 + * def __lshift__(self, another_set): + * self.update(another_set) + * return self # <<<<<<<<<<<<<< + * + * # += operator overload to extend the XSet with a second set + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__ = {__Pyx_NAMESTR("__iadd__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_set = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_set,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_set)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__iadd__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_set = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_4__iadd__(__pyx_self, __pyx_v_self, __pyx_v_another_set); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iadd__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":719 + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): + * self.update(another_set) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_another_set); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_another_set); + __Pyx_GIVEREF(__pyx_v_another_set); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":720 + * def __iadd__(self, another_set): + * self.update(another_set) + * return self # <<<<<<<<<<<<<< + * + * def xlist(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist = {__Pyx_NAMESTR("xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_6xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_6xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":723 + * + * def xlist(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XList(list(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":724 + * def xlist(self): + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) # <<<<<<<<<<<<<< + * + * def xfset(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset = {__Pyx_NAMESTR("xfset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xfset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_8xfset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_8xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xfset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":727 + * + * def xfset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XFSet(self, attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":728 + * def xfset(self): + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XFSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XFSet)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XFSet)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XFSet)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_set = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_set,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults7 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XFSet)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_set)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_set = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_set, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_set, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_set_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":737 + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_set); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_set); + __Pyx_GIVEREF(__pyx_v_the_set); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_set_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":738 + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(set_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":739 + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(set_obj, key, attributes[key]) + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":740 + * if len(attributes) > 0: + * for key in attributes: + * setattr(set_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + * return set_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_set_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":741 + * for key in attributes: + * setattr(set_obj, key, attributes[key]) + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) # <<<<<<<<<<<<<< + * return set_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_set_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":742 + * setattr(set_obj, key, attributes[key]) + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + * return set_obj # <<<<<<<<<<<<<< + * + * def _getAttributeDict(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_set_obj); + __pyx_r = __pyx_v_set_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":745 + * + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * def xlist(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist = {__Pyx_NAMESTR("xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_4xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_4xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":748 + * + * def xlist(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XList(list(self), attr_dict, naked_type="XList") + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":749 + * def xlist(self): + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") # <<<<<<<<<<<<<< + * + * def xset(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_naked_type, __pyx_n_s_XList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset = {__Pyx_NAMESTR("xset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_6xset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_6xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":752 + * + * def xset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XSet(self, attr_dict, naked_type="XSet") + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":753 + * def xset(self): + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_naked_type, __pyx_n_s_XSet) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_8type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_8type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":760 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":761 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":763 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XString)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XString)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XString)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_string_text = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults8 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XString)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString___new__(__pyx_self, __pyx_v_cls, __pyx_v_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_str_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":775 + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_string_text); + __Pyx_GIVEREF(__pyx_v_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_str_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":776 + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":777 + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":778 + * if len(attributes) > 0: + * for key in attributes: + * setattr(str_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(str_obj, '_naked_type_', naked_type) + * return str_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":779 + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # <<<<<<<<<<<<<< + * return str_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":780 + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) + * return str_obj # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_str_obj); + __pyx_r = __pyx_v_str_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":787 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_5type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_5type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_5type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_5type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_4type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":794 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":795 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":797 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * ## TODO: see where + vs. join breakpoint becomes important + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_7concat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_7concat = {__Pyx_NAMESTR("concat"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_7concat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_7concat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_strings = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("concat (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_strings = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_strings)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_strings); + } else { + __pyx_v_strings = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "concat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("concat", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_strings); __pyx_v_strings = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.concat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_6concat(__pyx_self, __pyx_v_self, __pyx_v_strings); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_strings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_6concat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_strings) { + PyObject *__pyx_v_str_list = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("concat", 0); + + /* "lib/Naked/toolshed/c/types.pyx":801 + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): + * str_list = [] # <<<<<<<<<<<<<< + * for x in strings: + * str_list.append(x) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_str_list = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":802 + * def concat(self, *strings): + * str_list = [] + * for x in strings: # <<<<<<<<<<<<<< + * str_list.append(x) + * return "".join(str_list) + */ + __pyx_t_1 = __pyx_v_strings; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":803 + * str_list = [] + * for x in strings: + * str_list.append(x) # <<<<<<<<<<<<<< + * return "".join(str_list) + * + */ + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_str_list, __pyx_v_x); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":804 + * for x in strings: + * str_list.append(x) + * return "".join(str_list) # <<<<<<<<<<<<<< + * + * # fastest substring search truth test + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_v_str_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.concat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_9contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_9contains = {__Pyx_NAMESTR("contains"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_9contains, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_9contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_substring = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("contains (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_substring,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_substring)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("contains", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contains") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_substring = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("contains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_8contains(__pyx_self, __pyx_v_self, __pyx_v_substring); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_substring) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("contains", 0); + + /* "lib/Naked/toolshed/c/types.pyx":808 + * # fastest substring search truth test + * def contains(self, substring): + * return substring in self # <<<<<<<<<<<<<< + * + * # split the string on one or more delimiters, return list + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_substring, __pyx_v_self, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit = {__Pyx_NAMESTR("xsplit"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_split_delimiter = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xsplit (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_split_delimiter,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_split_delimiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("xsplit", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xsplit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_split_delimiter = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xsplit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_10xsplit(__pyx_self, __pyx_v_self, __pyx_v_split_delimiter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_10xsplit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_re = NULL; + PyObject *__pyx_v_delim2 = NULL; + PyObject *__pyx_v_first_list = NULL; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_subitem = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xsplit", 0); + __Pyx_INCREF(__pyx_v_split_delimiter); + + /* "lib/Naked/toolshed/c/types.pyx":813 + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): + * length = len(split_delimiter) # <<<<<<<<<<<<<< + * if length > 2: + * import re + */ + __pyx_t_1 = PyObject_Length(__pyx_v_split_delimiter); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_1; + + /* "lib/Naked/toolshed/c/types.pyx":814 + * def xsplit(self, split_delimiter): + * length = len(split_delimiter) + * if length > 2: # <<<<<<<<<<<<<< + * import re + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + */ + __pyx_t_2 = ((__pyx_v_length > 2) != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":815 + * length = len(split_delimiter) + * if length > 2: + * import re # <<<<<<<<<<<<<< + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + * return re.split(split_delimiter, self) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_re = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":816 + * if length > 2: + * import re + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) # <<<<<<<<<<<<<< + * return re.split(split_delimiter, self) + * elif length > 1: + */ + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s__8); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s__8); + __Pyx_GIVEREF(__pyx_kp_s__8); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __Pyx_INCREF(__pyx_kp_s__9); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s__9); + __Pyx_GIVEREF(__pyx_kp_s__9); + __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_split_delimiter, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":817 + * import re + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + * return re.split(split_delimiter, self) # <<<<<<<<<<<<<< + * elif length > 1: + * delim2 = split_delimiter[1] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_re, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":818 + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + * return re.split(split_delimiter, self) + * elif length > 1: # <<<<<<<<<<<<<< + * delim2 = split_delimiter[1] + * first_list = self.split(split_delimiter[0]) + */ + __pyx_t_2 = ((__pyx_v_length > 1) != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":819 + * return re.split(split_delimiter, self) + * elif length > 1: + * delim2 = split_delimiter[1] # <<<<<<<<<<<<<< + * first_list = self.split(split_delimiter[0]) + * result_list = [] + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_split_delimiter, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_delim2 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":820 + * elif length > 1: + * delim2 = split_delimiter[1] + * first_list = self.split(split_delimiter[0]) # <<<<<<<<<<<<<< + * result_list = [] + * for item in first_list: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_split_delimiter, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_first_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":821 + * delim2 = split_delimiter[1] + * first_list = self.split(split_delimiter[0]) + * result_list = [] # <<<<<<<<<<<<<< + * for item in first_list: + * for subitem in item.split(delim2): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":822 + * first_list = self.split(split_delimiter[0]) + * result_list = [] + * for item in first_list: # <<<<<<<<<<<<<< + * for subitem in item.split(delim2): + * result_list.append(subitem) + */ + if (PyList_CheckExact(__pyx_v_first_list) || PyTuple_CheckExact(__pyx_v_first_list)) { + __pyx_t_3 = __pyx_v_first_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_first_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":823 + * result_list = [] + * for item in first_list: + * for subitem in item.split(delim2): # <<<<<<<<<<<<<< + * result_list.append(subitem) + * return result_list + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_delim2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_delim2); + __Pyx_GIVEREF(__pyx_v_delim2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_subitem, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":824 + * for item in first_list: + * for subitem in item.split(delim2): + * result_list.append(subitem) # <<<<<<<<<<<<<< + * return result_list + * else: + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_v_subitem); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":825 + * for subitem in item.split(delim2): + * result_list.append(subitem) + * return result_list # <<<<<<<<<<<<<< + * else: + * return self.split(split_delimiter) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result_list); + __pyx_r = __pyx_v_result_list; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":827 + * return result_list + * else: + * return self.split(split_delimiter) # <<<<<<<<<<<<<< + * + * # split the string on one or more characters and return items in set + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_re); + __Pyx_XDECREF(__pyx_v_delim2); + __Pyx_XDECREF(__pyx_v_first_list); + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_subitem); + __Pyx_XDECREF(__pyx_v_split_delimiter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set = {__Pyx_NAMESTR("xsplit_set"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_split_delimiter = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xsplit_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_split_delimiter,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_split_delimiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("xsplit_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xsplit_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_split_delimiter = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xsplit_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_12xsplit_set(__pyx_self, __pyx_v_self, __pyx_v_split_delimiter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_12xsplit_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xsplit_set", 0); + + /* "lib/Naked/toolshed/c/types.pyx":831 + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): + * return set(self.xsplit(split_delimiter)) # <<<<<<<<<<<<<< + * + * # str begins with substring - faster than str.startswith() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xsplit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_15begins(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_15begins = {__Pyx_NAMESTR("begins"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_15begins, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_15begins(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_begin_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("begins (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_begin_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_begin_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("begins", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begins") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_begin_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("begins", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.begins", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_14begins(__pyx_self, __pyx_v_self, __pyx_v_begin_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_14begins(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_begin_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("begins", 0); + + /* "lib/Naked/toolshed/c/types.pyx":835 + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): + * return begin_string in self[0:len(begin_string)] # <<<<<<<<<<<<<< + * + * # str ends with substring - faster than str.endswith() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_Length(__pyx_v_begin_string); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_self, 0, __pyx_t_1, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_begin_string, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.begins", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_17ends(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_17ends = {__Pyx_NAMESTR("ends"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_17ends, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_17ends(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_end_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ends (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_end_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ends", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ends") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_end_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ends", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.ends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_16ends(__pyx_self, __pyx_v_self, __pyx_v_end_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_16ends(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_end_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ends", 0); + + /* "lib/Naked/toolshed/c/types.pyx":839 + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): + * return end_string in self[-len(end_string):] # <<<<<<<<<<<<<< + * + * # case sensitive wildcard match on the XString (boolean returned) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_Length(__pyx_v_end_string); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_self, (-__pyx_t_1), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_end_string, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.ends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match = {__Pyx_NAMESTR("wildcard_match"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_wildcard = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wildcard_match (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wildcard,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wildcard)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wildcard_match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_wildcard = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_18wildcard_match(__pyx_self, __pyx_v_self, __pyx_v_wildcard); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_18wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard) { + PyObject *__pyx_v_fnmatchcase = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wildcard_match", 0); + + /* "lib/Naked/toolshed/c/types.pyx":843 + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): + * from fnmatch import fnmatchcase # <<<<<<<<<<<<<< + * return fnmatchcase(self, wildcard) + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_fnmatchcase); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_fnmatchcase); + __Pyx_GIVEREF(__pyx_n_s_fnmatchcase); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_fnmatch, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_fnmatchcase = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":844 + * def wildcard_match(self, wildcard): + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) # <<<<<<<<<<<<<< + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_wildcard); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_wildcard); + __Pyx_GIVEREF(__pyx_v_wildcard); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_fnmatchcase, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fnmatchcase); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode = {__Pyx_NAMESTR("unicode"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unicode (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_20unicode(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_20unicode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_version_info = NULL; + PyObject *__pyx_v_normalize = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unicode", 0); + + /* "lib/Naked/toolshed/c/types.pyx":848 + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): + * from sys import version_info # <<<<<<<<<<<<<< + * from unicodedata import normalize + * if version_info[0] == 2: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_version_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info); + __Pyx_GIVEREF(__pyx_n_s_version_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_version_info = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":849 + * def unicode(self): + * from sys import version_info + * from unicodedata import normalize # <<<<<<<<<<<<<< + * if version_info[0] == 2: + * return normalize('NFKD', self.decode('UTF-8')) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_normalize); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_normalize); + __Pyx_GIVEREF(__pyx_n_s_normalize); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_unicodedata, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_normalize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_normalize = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":850 + * from sys import version_info + * from unicodedata import normalize + * if version_info[0] == 2: # <<<<<<<<<<<<<< + * return normalize('NFKD', self.decode('UTF-8')) + * else: + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_version_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/types.pyx":851 + * from unicodedata import normalize + * if version_info[0] == 2: + * return normalize('NFKD', self.decode('UTF-8')) # <<<<<<<<<<<<<< + * else: + * return normalize('NFKD', self) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_normalize, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":853 + * return normalize('NFKD', self.decode('UTF-8')) + * else: + * return normalize('NFKD', self) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_normalize, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.unicode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_version_info); + __Pyx_XDECREF(__pyx_v_normalize); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XUnicode)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XUnicode)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XUnicode)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_string_text = 0; + PyObject *__pyx_v_attributes = 0; + CYTHON_UNUSED PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults9 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XUnicode)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode___init__(__pyx_self, __pyx_v_self, __pyx_v_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XUnicode2)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XUnicode2)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XUnicode2)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_2.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_string_text = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XUnicode2)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_2.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_str_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":865 + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyUnicode_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_string_text); + __Pyx_GIVEREF(__pyx_v_the_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_str_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":866 + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":867 + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":868 + * if len(attributes) > 0: + * for key in attributes: + * setattr(str_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + * return str_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":869 + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings # <<<<<<<<<<<<<< + * return str_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":870 + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + * return str_obj # <<<<<<<<<<<<<< + * + * class XUnicode_3(str): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_str_obj); + __pyx_r = __pyx_v_str_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_2.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XUnicode3)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XUnicode3)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XUnicode3)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_3.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_string_text = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XUnicode3)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_3.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_str_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":874 + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_string_text); + __Pyx_GIVEREF(__pyx_v_the_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_str_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":875 + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":876 + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":877 + * if len(attributes) > 0: + * for key in attributes: + * setattr(str_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + * return str_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":878 + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings # <<<<<<<<<<<<<< + * return str_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":879 + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + * return str_obj # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_str_obj); + __pyx_r = __pyx_v_str_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_3.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, CYTHON_UNUSED PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_sys = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_XUnicode_2 = NULL; + PyObject *__pyx_v_XUnicode_3 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":859 + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', string_text) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sys = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":860 + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', string_text) + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_unicodedata = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":861 + * import sys + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', string_text) # <<<<<<<<<<<<<< + * + * class XUnicode_2(unicode): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_string_text); + __Pyx_GIVEREF(__pyx_v_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_norm_text = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":863 + * norm_text = unicodedata.normalize('NFKD', string_text) + * + * class XUnicode_2(unicode): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyUnicode_Type)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyUnicode_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyUnicode_Type)))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_XUnicode_2, __pyx_n_s_XUnicode___init___locals_XUnicod, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XUnicode___init___locals_XUnicod_2, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults11), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_2__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":863 + * norm_text = unicodedata.normalize('NFKD', string_text) + * + * class XUnicode_2(unicode): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XUnicode_2, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_XUnicode_2 = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":872 + * return str_obj + * + * class XUnicode_3(str): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyString_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type)))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_XUnicode_3, __pyx_n_s_XUnicode___init___locals_XUnicod_3, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XUnicode___init___locals_XUnicod_4, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults12), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_2__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":872 + * return str_obj + * + * class XUnicode_3(str): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XUnicode_3, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_XUnicode_3 = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":882 + * + * + * if sys.version_info[0] == 2: # <<<<<<<<<<<<<< + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":883 + * + * if sys.version_info[0] == 2: + * self.obj = XUnicode_2(norm_text, attributes) # <<<<<<<<<<<<<< + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_XUnicode_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_obj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":884 + * if sys.version_info[0] == 2: + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text # <<<<<<<<<<<<<< + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_norm_unicode, __pyx_v_norm_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":885 + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string # <<<<<<<<<<<<<< + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + + /* "lib/Naked/toolshed/c/types.pyx":886 + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: # <<<<<<<<<<<<<< + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":887 + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_XUnicode_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_sys); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_XUnicode_2); + __Pyx_XDECREF(__pyx_v_XUnicode_3); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":891 + * def __str__(self): + * # return self.naked_u_string + * return self.obj # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_4__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":894 + * + * def __repr__(self): + * return self.naked_u_string # <<<<<<<<<<<<<< + * + * def __getattr__(self, the_attribute): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__ = {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_attribute = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_attribute,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_attribute)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_the_attribute = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_6__getattr__(__pyx_self, __pyx_v_self, __pyx_v_the_attribute); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_6__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_attribute) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":897 + * + * def __getattr__(self, the_attribute): + * return self.obj.__dict__[the_attribute] # <<<<<<<<<<<<<< + * + * def __cmp__(self, other_string): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_the_attribute); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__ = {__Pyx_NAMESTR("__cmp__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cmp__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cmp__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cmp__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__cmp__(__pyx_self, __pyx_v_self, __pyx_v_other_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__cmp__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + Py_hash_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cmp__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":900 + * + * def __cmp__(self, other_string): + * return hash(self.naked_u_string) == hash(other_string) # <<<<<<<<<<<<<< + * # TODO: add check for same attributes + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_Hash(__pyx_v_other_string); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_2 == __pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_10_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_10_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":908 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_12type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_12type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":915 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":916 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":918 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XTuple)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XTuple)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XTuple)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_tuple = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_tuple,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XTuple)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_tuple)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_tuple = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_tuple, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_tuple, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_tup_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":927 + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_tuple); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_tuple); + __Pyx_GIVEREF(__pyx_v_the_tuple); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tup_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":928 + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(tup_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":929 + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(tup_obj, key, attributes[key]) + * setattr(tup_obj, '_naked_type_', naked_type) + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":930 + * if len(attributes) > 0: + * for key in attributes: + * setattr(tup_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(tup_obj, '_naked_type_', naked_type) + * return tup_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_tup_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":931 + * for key in attributes: + * setattr(tup_obj, key, attributes[key]) + * setattr(tup_obj, '_naked_type_', naked_type) # <<<<<<<<<<<<<< + * return tup_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_tup_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":932 + * setattr(tup_obj, key, attributes[key]) + * setattr(tup_obj, '_naked_type_', naked_type) + * return tup_obj # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tup_obj); + __pyx_r = __pyx_v_tup_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":939 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_4type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":946 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":947 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":949 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("types"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_NFKD, __pyx_k_NFKD, sizeof(__pyx_k_NFKD), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject___eq, __pyx_k_NakedObject___eq, sizeof(__pyx_k_NakedObject___eq), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject___init, __pyx_k_NakedObject___init, sizeof(__pyx_k_NakedObject___init), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject___ne, __pyx_k_NakedObject___ne, sizeof(__pyx_k_NakedObject___ne), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject__equal_attributes, __pyx_k_NakedObject__equal_attributes, sizeof(__pyx_k_NakedObject__equal_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject__equal_type, __pyx_k_NakedObject__equal_type, sizeof(__pyx_k_NakedObject__equal_type), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject__getAttributeDict, __pyx_k_NakedObject__getAttributeDict, sizeof(__pyx_k_NakedObject__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject_equals, __pyx_k_NakedObject_equals, sizeof(__pyx_k_NakedObject_equals), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject_type, __pyx_k_NakedObject_type, sizeof(__pyx_k_NakedObject_type), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_python, __pyx_k_Naked_toolshed_python, sizeof(__pyx_k_Naked_toolshed_python), 0, 0, 1, 1}, + {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s_XDict, __pyx_k_XDict, sizeof(__pyx_k_XDict), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___add, __pyx_k_XDict___add, sizeof(__pyx_k_XDict___add), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___eq, __pyx_k_XDict___eq, sizeof(__pyx_k_XDict___eq), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___iadd, __pyx_k_XDict___iadd, sizeof(__pyx_k_XDict___iadd), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___init, __pyx_k_XDict___init, sizeof(__pyx_k_XDict___init), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___ne, __pyx_k_XDict___ne, sizeof(__pyx_k_XDict___ne), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_conditional_map_to_vals, __pyx_k_XDict_conditional_map_to_vals, sizeof(__pyx_k_XDict_conditional_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_difference, __pyx_k_XDict_difference, sizeof(__pyx_k_XDict_difference), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_equals, __pyx_k_XDict_equals, sizeof(__pyx_k_XDict_equals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_intersection, __pyx_k_XDict_intersection, sizeof(__pyx_k_XDict_intersection), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_key_xlist, __pyx_k_XDict_key_xlist, sizeof(__pyx_k_XDict_key_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_map_to_vals, __pyx_k_XDict_map_to_vals, sizeof(__pyx_k_XDict_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_max_val, __pyx_k_XDict_max_val, sizeof(__pyx_k_XDict_max_val), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_min_val, __pyx_k_XDict_min_val, sizeof(__pyx_k_XDict_min_val), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_random, __pyx_k_XDict_random, sizeof(__pyx_k_XDict_random), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_random_sample, __pyx_k_XDict_random_sample, sizeof(__pyx_k_XDict_random_sample), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_sum_vals, __pyx_k_XDict_sum_vals, sizeof(__pyx_k_XDict_sum_vals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_val_count, __pyx_k_XDict_val_count, sizeof(__pyx_k_XDict_val_count), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_val_count_ci, __pyx_k_XDict_val_count_ci, sizeof(__pyx_k_XDict_val_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_val_xlist, __pyx_k_XDict_val_xlist, sizeof(__pyx_k_XDict_val_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_xitems, __pyx_k_XDict_xitems, sizeof(__pyx_k_XDict_xitems), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet, __pyx_k_XFSet, sizeof(__pyx_k_XFSet), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet___new, __pyx_k_XFSet___new, sizeof(__pyx_k_XFSet___new), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet__getAttributeDict, __pyx_k_XFSet__getAttributeDict, sizeof(__pyx_k_XFSet__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet_type, __pyx_k_XFSet_type, sizeof(__pyx_k_XFSet_type), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet_xlist, __pyx_k_XFSet_xlist, sizeof(__pyx_k_XFSet_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet_xset, __pyx_k_XFSet_xset, sizeof(__pyx_k_XFSet_xset), 0, 0, 1, 1}, + {&__pyx_n_s_XList, __pyx_k_XList, sizeof(__pyx_k_XList), 0, 0, 1, 1}, + {&__pyx_n_s_XList___add, __pyx_k_XList___add, sizeof(__pyx_k_XList___add), 0, 0, 1, 1}, + {&__pyx_n_s_XList___eq, __pyx_k_XList___eq, sizeof(__pyx_k_XList___eq), 0, 0, 1, 1}, + {&__pyx_n_s_XList___iadd, __pyx_k_XList___iadd, sizeof(__pyx_k_XList___iadd), 0, 0, 1, 1}, + {&__pyx_n_s_XList___init, __pyx_k_XList___init, sizeof(__pyx_k_XList___init), 0, 0, 1, 1}, + {&__pyx_n_s_XList___ne, __pyx_k_XList___ne, sizeof(__pyx_k_XList___ne), 0, 0, 1, 1}, + {&__pyx_n_s_XList_conditional_map_to_items, __pyx_k_XList_conditional_map_to_items, sizeof(__pyx_k_XList_conditional_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_XList_count_ci, __pyx_k_XList_count_ci, sizeof(__pyx_k_XList_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_XList_count_duplicates, __pyx_k_XList_count_duplicates, sizeof(__pyx_k_XList_count_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_XList_difference, __pyx_k_XList_difference, sizeof(__pyx_k_XList_difference), 0, 0, 1, 1}, + {&__pyx_n_s_XList_equals, __pyx_k_XList_equals, sizeof(__pyx_k_XList_equals), 0, 0, 1, 1}, + {&__pyx_n_s_XList_intersection, __pyx_k_XList_intersection, sizeof(__pyx_k_XList_intersection), 0, 0, 1, 1}, + {&__pyx_n_s_XList_join, __pyx_k_XList_join, sizeof(__pyx_k_XList_join), 0, 0, 1, 1}, + {&__pyx_n_s_XList_map_to_items, __pyx_k_XList_map_to_items, sizeof(__pyx_k_XList_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_XList_max, __pyx_k_XList_max, sizeof(__pyx_k_XList_max), 0, 0, 1, 1}, + {&__pyx_n_s_XList_min, __pyx_k_XList_min, sizeof(__pyx_k_XList_min), 0, 0, 1, 1}, + {&__pyx_n_s_XList_multi_wildcard_match, __pyx_k_XList_multi_wildcard_match, sizeof(__pyx_k_XList_multi_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_XList_postfix, __pyx_k_XList_postfix, sizeof(__pyx_k_XList_postfix), 0, 0, 1, 1}, + {&__pyx_n_s_XList_prefix, __pyx_k_XList_prefix, sizeof(__pyx_k_XList_prefix), 0, 0, 1, 1}, + {&__pyx_n_s_XList_random, __pyx_k_XList_random, sizeof(__pyx_k_XList_random), 0, 0, 1, 1}, + {&__pyx_n_s_XList_random_sample, __pyx_k_XList_random_sample, sizeof(__pyx_k_XList_random_sample), 0, 0, 1, 1}, + {&__pyx_n_s_XList_remove_duplicates, __pyx_k_XList_remove_duplicates, sizeof(__pyx_k_XList_remove_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_XList_shuffle, __pyx_k_XList_shuffle, sizeof(__pyx_k_XList_shuffle), 0, 0, 1, 1}, + {&__pyx_n_s_XList_sum, __pyx_k_XList_sum, sizeof(__pyx_k_XList_sum), 0, 0, 1, 1}, + {&__pyx_n_s_XList_surround, __pyx_k_XList_surround, sizeof(__pyx_k_XList_surround), 0, 0, 1, 1}, + {&__pyx_n_s_XList_wildcard_match, __pyx_k_XList_wildcard_match, sizeof(__pyx_k_XList_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_XList_xfset, __pyx_k_XList_xfset, sizeof(__pyx_k_XList_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_XList_xset, __pyx_k_XList_xset, sizeof(__pyx_k_XList_xset), 0, 0, 1, 1}, + {&__pyx_n_s_XList_xtuple, __pyx_k_XList_xtuple, sizeof(__pyx_k_XList_xtuple), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap, __pyx_k_XMaxHeap, sizeof(__pyx_k_XMaxHeap), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap___init, __pyx_k_XMaxHeap___init, sizeof(__pyx_k_XMaxHeap___init), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap___len, __pyx_k_XMaxHeap___len, sizeof(__pyx_k_XMaxHeap___len), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_length, __pyx_k_XMaxHeap_length, sizeof(__pyx_k_XMaxHeap_length), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_pop, __pyx_k_XMaxHeap_pop, sizeof(__pyx_k_XMaxHeap_pop), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_push, __pyx_k_XMaxHeap_push, sizeof(__pyx_k_XMaxHeap_push), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_pushpop, __pyx_k_XMaxHeap_pushpop, sizeof(__pyx_k_XMaxHeap_pushpop), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap, __pyx_k_XMinHeap, sizeof(__pyx_k_XMinHeap), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap___init, __pyx_k_XMinHeap___init, sizeof(__pyx_k_XMinHeap___init), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap___len, __pyx_k_XMinHeap___len, sizeof(__pyx_k_XMinHeap___len), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_length, __pyx_k_XMinHeap_length, sizeof(__pyx_k_XMinHeap_length), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_pop, __pyx_k_XMinHeap_pop, sizeof(__pyx_k_XMinHeap_pop), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_push, __pyx_k_XMinHeap_push, sizeof(__pyx_k_XMinHeap_push), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_pushpop, __pyx_k_XMinHeap_pushpop, sizeof(__pyx_k_XMinHeap_pushpop), 0, 0, 1, 1}, + {&__pyx_n_s_XQueue, __pyx_k_XQueue, sizeof(__pyx_k_XQueue), 0, 0, 1, 1}, + {&__pyx_n_s_XQueue___init, __pyx_k_XQueue___init, sizeof(__pyx_k_XQueue___init), 0, 0, 1, 1}, + {&__pyx_n_s_XSet, __pyx_k_XSet, sizeof(__pyx_k_XSet), 0, 0, 1, 1}, + {&__pyx_n_s_XSet___iadd, __pyx_k_XSet___iadd, sizeof(__pyx_k_XSet___iadd), 0, 0, 1, 1}, + {&__pyx_n_s_XSet___init, __pyx_k_XSet___init, sizeof(__pyx_k_XSet___init), 0, 0, 1, 1}, + {&__pyx_n_s_XSet___lshift, __pyx_k_XSet___lshift, sizeof(__pyx_k_XSet___lshift), 0, 0, 1, 1}, + {&__pyx_n_s_XSet_xfset, __pyx_k_XSet_xfset, sizeof(__pyx_k_XSet_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_XSet_xlist, __pyx_k_XSet_xlist, sizeof(__pyx_k_XSet_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XString, __pyx_k_XString, sizeof(__pyx_k_XString), 0, 0, 1, 1}, + {&__pyx_n_s_XString___new, __pyx_k_XString___new, sizeof(__pyx_k_XString___new), 0, 0, 1, 1}, + {&__pyx_n_s_XString__getAttributeDict, __pyx_k_XString__getAttributeDict, sizeof(__pyx_k_XString__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XString_begins, __pyx_k_XString_begins, sizeof(__pyx_k_XString_begins), 0, 0, 1, 1}, + {&__pyx_n_s_XString_concat, __pyx_k_XString_concat, sizeof(__pyx_k_XString_concat), 0, 0, 1, 1}, + {&__pyx_n_s_XString_contains, __pyx_k_XString_contains, sizeof(__pyx_k_XString_contains), 0, 0, 1, 1}, + {&__pyx_n_s_XString_ends, __pyx_k_XString_ends, sizeof(__pyx_k_XString_ends), 0, 0, 1, 1}, + {&__pyx_n_s_XString_type, __pyx_k_XString_type, sizeof(__pyx_k_XString_type), 0, 0, 1, 1}, + {&__pyx_n_s_XString_unicode, __pyx_k_XString_unicode, sizeof(__pyx_k_XString_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_XString_wildcard_match, __pyx_k_XString_wildcard_match, sizeof(__pyx_k_XString_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_XString_xsplit, __pyx_k_XString_xsplit, sizeof(__pyx_k_XString_xsplit), 0, 0, 1, 1}, + {&__pyx_n_s_XString_xsplit_set, __pyx_k_XString_xsplit_set, sizeof(__pyx_k_XString_xsplit_set), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple, __pyx_k_XTuple, sizeof(__pyx_k_XTuple), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple___new, __pyx_k_XTuple___new, sizeof(__pyx_k_XTuple___new), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple__getAttributeDict, __pyx_k_XTuple__getAttributeDict, sizeof(__pyx_k_XTuple__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple_type, __pyx_k_XTuple_type, sizeof(__pyx_k_XTuple_type), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode, __pyx_k_XUnicode, sizeof(__pyx_k_XUnicode), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode2, __pyx_k_XUnicode2, sizeof(__pyx_k_XUnicode2), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode3, __pyx_k_XUnicode3, sizeof(__pyx_k_XUnicode3), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode_2, __pyx_k_XUnicode_2, sizeof(__pyx_k_XUnicode_2), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode_3, __pyx_k_XUnicode_3, sizeof(__pyx_k_XUnicode_3), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___cmp, __pyx_k_XUnicode___cmp, sizeof(__pyx_k_XUnicode___cmp), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___getattr, __pyx_k_XUnicode___getattr, sizeof(__pyx_k_XUnicode___getattr), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init, __pyx_k_XUnicode___init, sizeof(__pyx_k_XUnicode___init), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod, __pyx_k_XUnicode___init___locals_XUnicod, sizeof(__pyx_k_XUnicode___init___locals_XUnicod), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod_2, __pyx_k_XUnicode___init___locals_XUnicod_2, sizeof(__pyx_k_XUnicode___init___locals_XUnicod_2), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod_3, __pyx_k_XUnicode___init___locals_XUnicod_3, sizeof(__pyx_k_XUnicode___init___locals_XUnicod_3), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod_4, __pyx_k_XUnicode___init___locals_XUnicod_4, sizeof(__pyx_k_XUnicode___init___locals_XUnicod_4), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___repr, __pyx_k_XUnicode___repr, sizeof(__pyx_k_XUnicode___repr), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___str, __pyx_k_XUnicode___str, sizeof(__pyx_k_XUnicode___str), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode__getAttributeDict, __pyx_k_XUnicode__getAttributeDict, sizeof(__pyx_k_XUnicode__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode_type, __pyx_k_XUnicode_type, sizeof(__pyx_k_XUnicode_type), 0, 0, 1, 1}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, + {&__pyx_n_s_another_dict, __pyx_k_another_dict, sizeof(__pyx_k_another_dict), 0, 0, 1, 1}, + {&__pyx_n_s_another_list, __pyx_k_another_list, sizeof(__pyx_k_another_list), 0, 0, 1, 1}, + {&__pyx_n_s_another_set, __pyx_k_another_set, sizeof(__pyx_k_another_set), 0, 0, 1, 1}, + {&__pyx_n_s_attr_dict, __pyx_k_attr_dict, sizeof(__pyx_k_attr_dict), 0, 0, 1, 1}, + {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1}, + {&__pyx_n_s_begin_string, __pyx_k_begin_string, sizeof(__pyx_k_begin_string), 0, 0, 1, 1}, + {&__pyx_n_s_begins, __pyx_k_begins, sizeof(__pyx_k_begins), 0, 0, 1, 1}, + {&__pyx_n_s_choice, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_concat, __pyx_k_concat, sizeof(__pyx_k_concat), 0, 0, 1, 1}, + {&__pyx_n_s_conditional_function, __pyx_k_conditional_function, sizeof(__pyx_k_conditional_function), 0, 0, 1, 1}, + {&__pyx_n_s_conditional_map_to_items, __pyx_k_conditional_map_to_items, sizeof(__pyx_k_conditional_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_conditional_map_to_vals, __pyx_k_conditional_map_to_vals, sizeof(__pyx_k_conditional_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_count_ci, __pyx_k_count_ci, sizeof(__pyx_k_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_count_duplicates, __pyx_k_count_duplicates, sizeof(__pyx_k_count_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_delim2, __pyx_k_delim2, sizeof(__pyx_k_delim2), 0, 0, 1, 1}, + {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dict_obj, __pyx_k_dict_obj, sizeof(__pyx_k_dict_obj), 0, 0, 1, 1}, + {&__pyx_n_s_difference, __pyx_k_difference, sizeof(__pyx_k_difference), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end_string, __pyx_k_end_string, sizeof(__pyx_k_end_string), 0, 0, 1, 1}, + {&__pyx_n_s_ends, __pyx_k_ends, sizeof(__pyx_k_ends), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, + {&__pyx_n_s_equal_attributes, __pyx_k_equal_attributes, sizeof(__pyx_k_equal_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_equal_type, __pyx_k_equal_type, sizeof(__pyx_k_equal_type), 0, 0, 1, 1}, + {&__pyx_n_s_equals, __pyx_k_equals, sizeof(__pyx_k_equals), 0, 0, 1, 1}, + {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, + {&__pyx_n_s_first_list, __pyx_k_first_list, sizeof(__pyx_k_first_list), 0, 0, 1, 1}, + {&__pyx_n_s_fnmatch, __pyx_k_fnmatch, sizeof(__pyx_k_fnmatch), 0, 0, 1, 1}, + {&__pyx_n_s_fnmatchcase, __pyx_k_fnmatchcase, sizeof(__pyx_k_fnmatchcase), 0, 0, 1, 1}, + {&__pyx_n_s_getAttributeDict, __pyx_k_getAttributeDict, sizeof(__pyx_k_getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1}, + {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, + {&__pyx_n_s_heappush, __pyx_k_heappush, sizeof(__pyx_k_heappush), 0, 0, 1, 1}, + {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, + {&__pyx_n_s_iadd, __pyx_k_iadd, sizeof(__pyx_k_iadd), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_initial_iterable, __pyx_k_initial_iterable, sizeof(__pyx_k_initial_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_key_xlist, __pyx_k_key_xlist, sizeof(__pyx_k_key_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_types, __pyx_k_lib_Naked_toolshed_c_types, sizeof(__pyx_k_lib_Naked_toolshed_c_types), 0, 0, 1, 1}, + {&__pyx_n_s_list_obj, __pyx_k_list_obj, sizeof(__pyx_k_list_obj), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_lshift, __pyx_k_lshift, sizeof(__pyx_k_lshift), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map_to_items, __pyx_k_map_to_items, sizeof(__pyx_k_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_map_to_vals, __pyx_k_map_to_vals, sizeof(__pyx_k_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_mapped_function, __pyx_k_mapped_function, sizeof(__pyx_k_mapped_function), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_length, __pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 0, 1, 1}, + {&__pyx_n_s_max_val, __pyx_k_max_val, sizeof(__pyx_k_max_val), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_min_val, __pyx_k_min_val, sizeof(__pyx_k_min_val), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_multi_wildcard_match, __pyx_k_multi_wildcard_match, sizeof(__pyx_k_multi_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_naked_type, __pyx_k_naked_type, sizeof(__pyx_k_naked_type), 0, 0, 1, 1}, + {&__pyx_n_s_naked_type_2, __pyx_k_naked_type_2, sizeof(__pyx_k_naked_type_2), 0, 0, 1, 1}, + {&__pyx_n_s_naked_u_string, __pyx_k_naked_u_string, sizeof(__pyx_k_naked_u_string), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_new_dict, __pyx_k_new_dict, sizeof(__pyx_k_new_dict), 0, 0, 1, 1}, + {&__pyx_n_s_nkd_fnmatchcase, __pyx_k_nkd_fnmatchcase, sizeof(__pyx_k_nkd_fnmatchcase), 0, 0, 1, 1}, + {&__pyx_n_s_norm_text, __pyx_k_norm_text, sizeof(__pyx_k_norm_text), 0, 0, 1, 1}, + {&__pyx_n_s_norm_unicode, __pyx_k_norm_unicode, sizeof(__pyx_k_norm_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_number_of_items, __pyx_k_number_of_items, sizeof(__pyx_k_number_of_items), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1}, + {&__pyx_n_s_other_lists, __pyx_k_other_lists, sizeof(__pyx_k_other_lists), 0, 0, 1, 1}, + {&__pyx_n_s_other_obj, __pyx_k_other_obj, sizeof(__pyx_k_other_obj), 0, 0, 1, 1}, + {&__pyx_n_s_other_string, __pyx_k_other_string, sizeof(__pyx_k_other_string), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_postfix, __pyx_k_postfix, sizeof(__pyx_k_postfix), 0, 0, 1, 1}, + {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_push, __pyx_k_push, sizeof(__pyx_k_push), 0, 0, 1, 1}, + {&__pyx_n_s_pushpop, __pyx_k_pushpop, sizeof(__pyx_k_pushpop), 0, 0, 1, 1}, + {&__pyx_n_s_py_major_version, __pyx_k_py_major_version, sizeof(__pyx_k_py_major_version), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, + {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, + {&__pyx_n_s_random_key_list, __pyx_k_random_key_list, sizeof(__pyx_k_random_key_list), 0, 0, 1, 1}, + {&__pyx_n_s_random_sample, __pyx_k_random_sample, sizeof(__pyx_k_random_sample), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_remove_duplicates, __pyx_k_remove_duplicates, sizeof(__pyx_k_remove_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_list, __pyx_k_result_list, sizeof(__pyx_k_result_list), 0, 0, 1, 1}, + {&__pyx_n_s_return_list, __pyx_k_return_list, sizeof(__pyx_k_return_list), 0, 0, 1, 1}, + {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1}, + {&__pyx_n_s_set_obj, __pyx_k_set_obj, sizeof(__pyx_k_set_obj), 0, 0, 1, 1}, + {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_split_delimiter, __pyx_k_split_delimiter, sizeof(__pyx_k_split_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_str_list, __pyx_k_str_list, sizeof(__pyx_k_str_list), 0, 0, 1, 1}, + {&__pyx_n_s_str_obj, __pyx_k_str_obj, sizeof(__pyx_k_str_obj), 0, 0, 1, 1}, + {&__pyx_n_s_string_text, __pyx_k_string_text, sizeof(__pyx_k_string_text), 0, 0, 1, 1}, + {&__pyx_n_s_strings, __pyx_k_strings, sizeof(__pyx_k_strings), 0, 0, 1, 1}, + {&__pyx_n_s_subitem, __pyx_k_subitem, sizeof(__pyx_k_subitem), 0, 0, 1, 1}, + {&__pyx_n_s_substring, __pyx_k_substring, sizeof(__pyx_k_substring), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sum_vals, __pyx_k_sum_vals, sizeof(__pyx_k_sum_vals), 0, 0, 1, 1}, + {&__pyx_n_s_surround, __pyx_k_surround, sizeof(__pyx_k_surround), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_temp_list, __pyx_k_temp_list, sizeof(__pyx_k_temp_list), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_string, __pyx_k_test_string, sizeof(__pyx_k_test_string), 0, 0, 1, 1}, + {&__pyx_n_s_test_value, __pyx_k_test_value, sizeof(__pyx_k_test_value), 0, 0, 1, 1}, + {&__pyx_n_s_the_attribute, __pyx_k_the_attribute, sizeof(__pyx_k_the_attribute), 0, 0, 1, 1}, + {&__pyx_n_s_the_key, __pyx_k_the_key, sizeof(__pyx_k_the_key), 0, 0, 1, 1}, + {&__pyx_n_s_the_list, __pyx_k_the_list, sizeof(__pyx_k_the_list), 0, 0, 1, 1}, + {&__pyx_n_s_the_object, __pyx_k_the_object, sizeof(__pyx_k_the_object), 0, 0, 1, 1}, + {&__pyx_n_s_the_set, __pyx_k_the_set, sizeof(__pyx_k_the_set), 0, 0, 1, 1}, + {&__pyx_n_s_the_string_text, __pyx_k_the_string_text, sizeof(__pyx_k_the_string_text), 0, 0, 1, 1}, + {&__pyx_n_s_the_tuple, __pyx_k_the_tuple, sizeof(__pyx_k_the_tuple), 0, 0, 1, 1}, + {&__pyx_n_s_tup_obj, __pyx_k_tup_obj, sizeof(__pyx_k_tup_obj), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_val_count, __pyx_k_val_count, sizeof(__pyx_k_val_count), 0, 0, 1, 1}, + {&__pyx_n_s_val_count_ci, __pyx_k_val_count_ci, sizeof(__pyx_k_val_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_val_xlist, __pyx_k_val_xlist, sizeof(__pyx_k_val_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_value_name, __pyx_k_value_name, sizeof(__pyx_k_value_name), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_wc, __pyx_k_wc, sizeof(__pyx_k_wc), 0, 0, 1, 1}, + {&__pyx_n_s_wc_list, __pyx_k_wc_list, sizeof(__pyx_k_wc_list), 0, 0, 1, 1}, + {&__pyx_n_s_wildcard, __pyx_k_wildcard, sizeof(__pyx_k_wildcard), 0, 0, 1, 1}, + {&__pyx_n_s_wildcard_match, __pyx_k_wildcard_match, sizeof(__pyx_k_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_wildcards, __pyx_k_wildcards, sizeof(__pyx_k_wildcards), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xfset, __pyx_k_xfset, sizeof(__pyx_k_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_xitems, __pyx_k_xitems, sizeof(__pyx_k_xitems), 0, 0, 1, 1}, + {&__pyx_n_s_xlist, __pyx_k_xlist, sizeof(__pyx_k_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_xset, __pyx_k_xset, sizeof(__pyx_k_xset), 0, 0, 1, 1}, + {&__pyx_n_s_xsplit, __pyx_k_xsplit, sizeof(__pyx_k_xsplit), 0, 0, 1, 1}, + {&__pyx_n_s_xsplit_set, __pyx_k_xsplit_set, sizeof(__pyx_k_xsplit_set), 0, 0, 1, 1}, + {&__pyx_n_s_xtuple, __pyx_k_xtuple, sizeof(__pyx_k_xtuple), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/types.pyx":107 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/types.pyx":126 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/types.pyx":338 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/types.pyx":358 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "lib/Naked/toolshed/c/types.pyx":574 + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') # <<<<<<<<<<<<<< + * return_list = [] + * for wc in wc_list: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/types.pyx":851 + * from unicodedata import normalize + * if version_info[0] == 2: + * return normalize('NFKD', self.decode('UTF-8')) # <<<<<<<<<<<<<< + * else: + * return normalize('NFKD', self) + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_tuple__11 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_str_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_tuple__13 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_str_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 873, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":885 + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string # <<<<<<<<<<<<<< + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/types.pyx":887 + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_key); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equal_type, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equal_attributes, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_eq, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_obj, __pyx_n_s_result); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ne, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equals, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_dict_obj, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_add, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_iadd, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_eq, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_obj, __pyx_n_s_result); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ne, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equals, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_conditional_function, __pyx_n_s_mapped_function, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_conditional_map_to_vals, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mapped_function, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_map_to_vals, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_val_xlist, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_max_val, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_min_val, 202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_sum_vals, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_tuple__57 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value_name, __pyx_n_s_count, __pyx_n_s_test_value); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_val_count, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_tuple__59 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value_name, __pyx_n_s_count, __pyx_n_s_test_value); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_val_count_ci, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_dict); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_difference, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_dict); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_intersection, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_key_xlist, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + __pyx_tuple__67 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_random, __pyx_n_s_py_major_version, __pyx_n_s_random_key_list, __pyx_n_s_the_key); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + __pyx_tuple__69 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_number_of_items, __pyx_n_s_random, __pyx_n_s_random_key_list, __pyx_n_s_new_dict, __pyx_n_s_item); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random_sample, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_py_major_version); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xitems, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_list_obj, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_other_lists, __pyx_n_s_the_list, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_add, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + __pyx_tuple__77 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_another_list, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_iadd, 345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_eq, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_obj, __pyx_n_s_result); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ne, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equals, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_join, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__5)); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + + /* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_after, __pyx_n_s_x); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_postfix, 409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + __pyx_tuple__90 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_x); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_prefix, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + __pyx_tuple__92 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_x); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_surround, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__94 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__5)); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + + /* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_max, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_min, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_sum, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_count_duplicates, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + __pyx_tuple__103 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_remove_duplicates, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + __pyx_tuple__105 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_list); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_difference, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_list); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_intersection, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + __pyx_tuple__109 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mapped_function, __pyx_n_s_index_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); + __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_map_to_items, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + __pyx_tuple__111 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_conditional_function, __pyx_n_s_mapped_function, __pyx_n_s_index_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_conditional_map_to_items, 500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + __pyx_tuple__113 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_test_string, __pyx_n_s_count, __pyx_n_s_item); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_count_ci, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_random); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + __pyx_tuple__117 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_number_of_items, __pyx_n_s_random); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random_sample, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + __pyx_tuple__119 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_random); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_shuffle, 544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_tuple__121 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_wildcard, __pyx_n_s_fnmatchcase, __pyx_n_s_x); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wildcard_match, 556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_tuple__123 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_wildcards, __pyx_n_s_fnmatchcase, __pyx_n_s_wc_list, __pyx_n_s_return_list, __pyx_n_s_wc, __pyx_n_s_temp_list, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_multi_wildcard_match, 568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xset, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + __pyx_tuple__127 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xfset, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xtuple, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_len, 621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_push, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__137); + __Pyx_GIVEREF(__pyx_tuple__137); + __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pop, 630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__139 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__139); + __Pyx_GIVEREF(__pyx_tuple__139); + __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pushpop, 637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__141); + __Pyx_GIVEREF(__pyx_tuple__141); + __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_length, 646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_tuple__143 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__143); + __Pyx_GIVEREF(__pyx_tuple__143); + __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 655, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_len, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__147); + __Pyx_GIVEREF(__pyx_tuple__147); + __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_push, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__149); + __Pyx_GIVEREF(__pyx_tuple__149); + __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pop, 671, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__151 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__151); + __Pyx_GIVEREF(__pyx_tuple__151); + __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pushpop, 678, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__153); + __Pyx_GIVEREF(__pyx_tuple__153); + __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_length, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__155 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_initial_iterable, __pyx_n_s_attributes, __pyx_n_s_max_length, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__155); + __Pyx_GIVEREF(__pyx_tuple__155); + __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__157 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_set_obj, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_set); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_lshift, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_tuple__161 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_set); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__161); + __Pyx_GIVEREF(__pyx_tuple__161); + __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_iadd, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__163); + __Pyx_GIVEREF(__pyx_tuple__163); + __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xlist, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__165); + __Pyx_GIVEREF(__pyx_tuple__165); + __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xfset, 726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + __pyx_tuple__167 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_set, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_set_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__167); + __Pyx_GIVEREF(__pyx_tuple__167); + __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__169); + __Pyx_GIVEREF(__pyx_tuple__169); + __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + __pyx_tuple__171 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__171); + __Pyx_GIVEREF(__pyx_tuple__171); + __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xlist, 747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__173); + __Pyx_GIVEREF(__pyx_tuple__173); + __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xset, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__175 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__175); + __Pyx_GIVEREF(__pyx_tuple__175); + __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + __pyx_tuple__177 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_str_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__177); + __Pyx_GIVEREF(__pyx_tuple__177); + __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__179); + __Pyx_GIVEREF(__pyx_tuple__179); + __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__181); + __Pyx_GIVEREF(__pyx_tuple__181); + __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + __pyx_tuple__183 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_strings, __pyx_n_s_str_list, __pyx_n_s_x); if (unlikely(!__pyx_tuple__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__183); + __Pyx_GIVEREF(__pyx_tuple__183); + __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_concat, 800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + __pyx_tuple__185 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_substring); if (unlikely(!__pyx_tuple__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__185); + __Pyx_GIVEREF(__pyx_tuple__185); + __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_contains, 807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + __pyx_tuple__187 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_split_delimiter, __pyx_n_s_length, __pyx_n_s_re, __pyx_n_s_delim2, __pyx_n_s_first_list, __pyx_n_s_result_list, __pyx_n_s_item, __pyx_n_s_subitem); if (unlikely(!__pyx_tuple__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__187); + __Pyx_GIVEREF(__pyx_tuple__187); + __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xsplit, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_split_delimiter); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__189); + __Pyx_GIVEREF(__pyx_tuple__189); + __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xsplit_set, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_begin_string); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__191); + __Pyx_GIVEREF(__pyx_tuple__191); + __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_begins, 834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + __pyx_tuple__193 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_end_string); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ends, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + __pyx_tuple__195 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_wildcard, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wildcard_match, 842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + __pyx_tuple__197 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_version_info, __pyx_n_s_normalize); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__197); + __Pyx_GIVEREF(__pyx_tuple__197); + __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_unicode, 847, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + __pyx_tuple__199 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_sys, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_XUnicode_2, __pyx_n_s_XUnicode_3); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + __pyx_tuple__201 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_str, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + __pyx_tuple__203 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_repr, 893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + __pyx_tuple__205 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_the_attribute); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getattr, 896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + __pyx_tuple__207 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_string); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_cmp, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 907, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + __pyx_tuple__213 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_tuple, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_tup_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 938, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC inittypes(void); /*proto*/ +PyMODINIT_FUNC inittypes(void) +#else +PyMODINIT_FUNC PyInit_types(void); /*proto*/ +PyMODINIT_FUNC PyInit_types(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_types(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("types"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__types) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.types")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.types", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/types.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":6 + * + * import sys + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":15 + * # Attribute accessors: hasattr, getattr, setattr, delattr + * #------------------------------------------------------------------------------ + * class NakedObject(object): # <<<<<<<<<<<<<< + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_NakedObject, __pyx_n_s_NakedObject, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__, 0, __pyx_n_s_NakedObject___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_16__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict, 0, __pyx_n_s_NakedObject__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type, 0, __pyx_n_s_NakedObject__equal_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equal_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes, 0, __pyx_n_s_NakedObject__equal_attributes, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equal_attributes, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__, 0, __pyx_n_s_NakedObject___eq, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__, 0, __pyx_n_s_NakedObject___ne, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals, 0, __pyx_n_s_NakedObject_equals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type, 0, __pyx_n_s_NakedObject_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":15 + * # Attribute accessors: hasattr, getattr, setattr, delattr + * #------------------------------------------------------------------------------ + * class NakedObject(object): # <<<<<<<<<<<<<< + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NakedObject, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NakedObject, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":82 + * # An inherited extension to the dictionary type + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyDict_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_XDict, __pyx_n_s_XDict, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__, 0, __pyx_n_s_XDict___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_40__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__, 0, __pyx_n_s_XDict___add, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__, 0, __pyx_n_s_XDict___iadd, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_iadd, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__, 0, __pyx_n_s_XDict___eq, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__, 0, __pyx_n_s_XDict___ne, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals, 0, __pyx_n_s_XDict_equals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals, 0, __pyx_n_s_XDict_conditional_map_to_vals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_conditional_map_to_vals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals, 0, __pyx_n_s_XDict_map_to_vals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_map_to_vals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist, 0, __pyx_n_s_XDict_val_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_val_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val, 0, __pyx_n_s_XDict_max_val, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_max_val, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val, 0, __pyx_n_s_XDict_min_val, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_min_val, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals, 0, __pyx_n_s_XDict_sum_vals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_sum_vals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count, 0, __pyx_n_s_XDict_val_count, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_val_count, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci, 0, __pyx_n_s_XDict_val_count_ci, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_val_count_ci, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference, 0, __pyx_n_s_XDict_difference, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_difference, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection, 0, __pyx_n_s_XDict_intersection, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_intersection, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist, 0, __pyx_n_s_XDict_key_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_key_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_35random, 0, __pyx_n_s_XDict_random, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample, 0, __pyx_n_s_XDict_random_sample, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random_sample, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems, 0, __pyx_n_s_XDict_xitems, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xitems, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":82 + * # An inherited extension to the dictionary type + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XDict, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":311 + * # An inherited extension to the list object that permits attachment of attributes + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyList_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XList, __pyx_n_s_XList, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__, 0, __pyx_n_s_XList___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults2), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_56__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__, 0, __pyx_n_s_XList___add, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__, 0, __pyx_n_s_XList___iadd, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_iadd, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__, 0, __pyx_n_s_XList___eq, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__, 0, __pyx_n_s_XList___ne, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_11equals, 0, __pyx_n_s_XList_equals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_13join, 0, __pyx_n_s_XList_join, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__87); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_join, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix, 0, __pyx_n_s_XList_postfix, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_postfix, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix, 0, __pyx_n_s_XList_prefix, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_prefix, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_19surround, 0, __pyx_n_s_XList_surround, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__94); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_surround, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_21max, 0, __pyx_n_s_XList_max, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_max, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_23min, 0, __pyx_n_s_XList_min, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_min, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_25sum, 0, __pyx_n_s_XList_sum, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_sum, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates, 0, __pyx_n_s_XList_count_duplicates, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_count_duplicates, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates, 0, __pyx_n_s_XList_remove_duplicates, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_remove_duplicates, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_31difference, 0, __pyx_n_s_XList_difference, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_difference, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection, 0, __pyx_n_s_XList_intersection, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_intersection, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items, 0, __pyx_n_s_XList_map_to_items, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_map_to_items, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items, 0, __pyx_n_s_XList_conditional_map_to_items, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_conditional_map_to_items, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci, 0, __pyx_n_s_XList_count_ci, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_count_ci, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_41random, 0, __pyx_n_s_XList_random, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample, 0, __pyx_n_s_XList_random_sample, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random_sample, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle, 0, __pyx_n_s_XList_shuffle, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_shuffle, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match, 0, __pyx_n_s_XList_wildcard_match, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_wildcard_match, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match, 0, __pyx_n_s_XList_multi_wildcard_match, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_multi_wildcard_match, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_51xset, 0, __pyx_n_s_XList_xset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset, 0, __pyx_n_s_XList_xfset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xfset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple, 0, __pyx_n_s_XList_xtuple, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xtuple, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":311 + * # An inherited extension to the list object that permits attachment of attributes + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XList, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XList, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":613 + * # max heap queue + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop # <<<<<<<<<<<<<< + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappush); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush); + __Pyx_GIVEREF(__pyx_n_s_heappush); + __Pyx_INCREF(__pyx_n_s_heappop); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_heappop); + __Pyx_GIVEREF(__pyx_n_s_heappop); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappush, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":614 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XMaxHeap, __pyx_n_s_XMaxHeap, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__, 0, __pyx_n_s_XMaxHeap___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults3), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_12__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__, 0, __pyx_n_s_XMaxHeap___len, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_len, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push, 0, __pyx_n_s_XMaxHeap_push, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_push, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop, 0, __pyx_n_s_XMaxHeap_pop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop, 0, __pyx_n_s_XMaxHeap_pushpop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pushpop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length, 0, __pyx_n_s_XMaxHeap_length, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":614 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XMaxHeap, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMaxHeap, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":653 + * # min heap queue + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop # <<<<<<<<<<<<<< + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappush); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush); + __Pyx_GIVEREF(__pyx_n_s_heappush); + __Pyx_INCREF(__pyx_n_s_heappop); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_heappop); + __Pyx_GIVEREF(__pyx_n_s_heappop); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappush, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":654 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XMinHeap, __pyx_n_s_XMinHeap, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__, 0, __pyx_n_s_XMinHeap___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults4), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_12__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__, 0, __pyx_n_s_XMinHeap___len, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_len, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push, 0, __pyx_n_s_XMinHeap_push, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_push, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop, 0, __pyx_n_s_XMinHeap_pop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop, 0, __pyx_n_s_XMinHeap_pushpop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pushpop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length, 0, __pyx_n_s_XMinHeap_length, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":654 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XMinHeap, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMinHeap, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":695 + * # + * #------------------------------------------------------------------------------ + * from collections import deque # <<<<<<<<<<<<<< + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_deque); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_deque); + __Pyx_GIVEREF(__pyx_n_s_deque); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_deque); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deque, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":696 + * #------------------------------------------------------------------------------ + * from collections import deque + * class XQueue(deque, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_deque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_XQueue, __pyx_n_s_XQueue, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__, 0, __pyx_n_s_XQueue___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults5), 2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_initial_iterable = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue_2__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":696 + * #------------------------------------------------------------------------------ + * from collections import deque + * class XQueue(deque, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XQueue, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XQueue, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":707 + * # Inherits from set and from NakedObject (see methods in NakedObject at top of this module + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PySet_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PySet_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PySet_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XSet, __pyx_n_s_XSet, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__, 0, __pyx_n_s_XSet___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults6), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_10__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__, 0, __pyx_n_s_XSet___lshift, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lshift, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__, 0, __pyx_n_s_XSet___iadd, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_iadd, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist, 0, __pyx_n_s_XSet_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset, 0, __pyx_n_s_XSet_xfset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xfset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":707 + * # Inherits from set and from NakedObject (see methods in NakedObject at top of this module + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XSet, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSet, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":735 + * # Immutable so there is no setter method, attributes must be set in the constructor + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): # <<<<<<<<<<<<<< + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFrozenSet_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyFrozenSet_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFrozenSet_Type)))); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XFSet, __pyx_n_s_XFSet, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XFSet___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults7), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_10__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict, 0, __pyx_n_s_XFSet__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist, 0, __pyx_n_s_XFSet_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset, 0, __pyx_n_s_XFSet_xset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type, 0, __pyx_n_s_XFSet_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":735 + * # Immutable so there is no setter method, attributes must be set in the constructor + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): # <<<<<<<<<<<<<< + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XFSet, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XFSet, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":773 + * # Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method + * #------------------------------------------------------------------------------ + * class XString(str): # <<<<<<<<<<<<<< + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type)))); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XString, __pyx_n_s_XString, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XString___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults8), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_22__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict, 0, __pyx_n_s_XString__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_5type, 0, __pyx_n_s_XString_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_7concat, 0, __pyx_n_s_XString_concat, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_concat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_9contains, 0, __pyx_n_s_XString_contains, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_contains, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit, 0, __pyx_n_s_XString_xsplit, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xsplit, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set, 0, __pyx_n_s_XString_xsplit_set, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xsplit_set, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_15begins, 0, __pyx_n_s_XString_begins, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_begins, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_17ends, 0, __pyx_n_s_XString_ends, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ends, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match, 0, __pyx_n_s_XString_wildcard_match, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_wildcard_match, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode, 0, __pyx_n_s_XString_unicode, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_unicode, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":773 + * # Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method + * #------------------------------------------------------------------------------ + * class XString(str): # <<<<<<<<<<<<<< + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XString, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XString, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":857 + * + * # this version works + * class XUnicode: # <<<<<<<<<<<<<< + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_XUnicode, __pyx_n_s_XUnicode, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__, 0, __pyx_n_s_XUnicode___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_3)->__pyx_arg_attributes = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_14__defaults__); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__, 0, __pyx_n_s_XUnicode___str, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_str, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__, 0, __pyx_n_s_XUnicode___repr, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_repr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__, 0, __pyx_n_s_XUnicode___getattr, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__, 0, __pyx_n_s_XUnicode___cmp, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict, 0, __pyx_n_s_XUnicode__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_getAttributeDict, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type, 0, __pyx_n_s_XUnicode_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":857 + * + * # this version works + * class XUnicode: # <<<<<<<<<<<<<< + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys + */ + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_XUnicode, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XUnicode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":925 + * # + * #------------------------------------------------------------------------------ + * class XTuple(tuple): # <<<<<<<<<<<<<< + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyTuple_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XTuple, __pyx_n_s_XTuple, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XTuple___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults10), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_6__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict, 0, __pyx_n_s_XTuple__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type, 0, __pyx_n_s_XTuple_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":925 + * # + * #------------------------------------------------------------------------------ + * class XTuple(tuple): # <<<<<<<<<<<<<< + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XTuple, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XTuple, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":952 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # no = nobj({"version":"1.0.1", "test":"code"}) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/types.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.types", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.types"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL) +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.pyx b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.pyx new file mode 100644 index 00000000..49840acf --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/c/types.pyx @@ -0,0 +1,999 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [[ NakedObject class ]] +# A generic Python object +# Assigns object attributes by key name in the dictionary argument to the constructor +# The methods are inherited by other mutable Naked object extension types +# Attribute accessors: hasattr, getattr, setattr, delattr +#------------------------------------------------------------------------------ +class NakedObject(object): + # initialize with an attributes dictionary {attribute_name: attribute_value} + def __init__(self, attributes={}, naked_type='NakedObject'): + if len(attributes) > 0: + for key in attributes: + setattr(self, key, attributes[key]) + setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ _equal_type method ] (boolean) + # returns boolean for type of instance == type of test parameter instance + #------------------------------------------------------------------------------ + def _equal_type(self, other_obj): + return type(self) == type(other_obj) + + #------------------------------------------------------------------------------ + # [ _equal_attributes metod ] (method) + # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + #------------------------------------------------------------------------------ + def _equal_attributes(self, other_obj): + return self.__dict__ == other_obj.__dict__ + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # equality testing based on type and attributes + # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + #------------------------------------------------------------------------------ + def equals(self, other_obj): + return self._equal_type(other_obj) and self._equal_attributes(other_obj) + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + +#------------------------------------------------------------------------------ +# [[ XDict class ]] +# An inherited extension to the dictionary type +#------------------------------------------------------------------------------ +class XDict(dict, NakedObject): + def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + dict.__init__(self, dict_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XDict Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + overload + # overwrites existing keys with key:value pairs from new dictionaries if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __add__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # +- overload + # overwrites existing keys with another_dict (right sided argument) keys if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __iadd__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XDict (type, attributes, dictionary equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if dict(self) == dict(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XDict Value Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ conditional_map_to_vals method ] (XDict) + # returns the original XDict with values that meet True condition in `conditional_function` + # modified as per the `mapped_function` with single value argument call + # Test: test_xdict_conditional_map + #------------------------------------------------------------------------------ + def conditional_map_to_vals(self, conditional_function, mapped_function): + for key, value in self.xitems(): + if conditional_function(key): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ map_to_vals method ] (XDict) + # returns the original XDict with all values modified as per the `mapped_function` + # Test: test_xdict_map_to_vals + #------------------------------------------------------------------------------ + def map_to_vals(self, mapped_function): + # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + for key, value in self.xitems(): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ val_xlist method ] (XList) + # return an XList of the values in the XDict + # Test: test_xdict_val_xlist + #------------------------------------------------------------------------------ + def val_xlist(self): + return XList(self.values(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ max_val method ] (tuple of maximum value and associated key) + # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + #------------------------------------------------------------------------------ + def max_val(self): + return max(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ min_val method ] (tuple of minimum value and associated key) + #------------------------------------------------------------------------------ + def min_val(self): + return min(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ sum_vals method ] (numeric return type dependent upon original value type) + # returns sum of all values in the dictionary + #------------------------------------------------------------------------------ + def sum_vals(self): + return sum(self.values()) + + #------------------------------------------------------------------------------ + # [ val_count method ] (integer) + # returns an integer value for the total count of `value_name` in the dictionary values + # Case sensitive test if comparing strings + # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + #------------------------------------------------------------------------------ + def val_count(self, value_name): + count = 0 + for test_value in self.values(): + if value_name == test_value: + count += 1 + return count + + #------------------------------------------------------------------------------ + # [ value_count_ci method ] (integer) + # returns an integer value for the total count of case insensitive `value_name` + # strings/char in the dictionary values. Can include non-string types (ignores them) + # Test: test_xdict_val_count_ci + #------------------------------------------------------------------------------ + def val_count_ci(self, value_name): + count = 0 + for test_value in self.values(): + try: + if value_name.lower() in test_value.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + + #------------------------------------------------------------------------------ + # XDict Key Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ difference method ] (difference set of keys) + # definition: keys that are included in self, but not in `another_dict` + # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + #------------------------------------------------------------------------------ + def difference(self, another_dict): + return set(self.keys()) - set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ intersection method ] (intersection set of keys) + # definition: keys that are included in both self and `another_dict` + # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + #------------------------------------------------------------------------------ + def intersection(self, another_dict): + return set(self.keys()) & set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ key_xlist method ] (XList) + # returns an XList of the keys in the XDict + # Test: test_xdict_key_xlist + #------------------------------------------------------------------------------ + def key_xlist(self): + return XList(self.keys(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ random method ] (dictionary) + # return new Python dictionary with single, random key:value pair + # Test: test_xdict_key_random + #------------------------------------------------------------------------------ + def random(self): + import random + from Naked.toolshed.python import py_major_version + random_key_list = random.sample(self.keys(), 1) + the_key = random_key_list[0] + return {the_key: self[the_key]} + + #------------------------------------------------------------------------------ + # [ random_sample method ] (dictionary) + # return new Python dictionary with `number_of_items` random key:value pairs + # Test: test_xdict_key_random_sample + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + random_key_list = random.sample(self.keys(), number_of_items) + new_dict = {} + for item in random_key_list: + new_dict[item] = self[item] + return new_dict + + #------------------------------------------------------------------------------ + # [ xitems method ] (tuple) + # Generator method that returns tuples of every key, value in dictionary + # uses appropriate method from Python 2 and 3 interpreters + # Test: test_xdict_xitems + #------------------------------------------------------------------------------ + def xitems(self): + from Naked.toolshed.python import py_major_version + if py_major_version() > 2: + return self.items() + else: + return self.iteritems() + +#------------------------------------------------------------------------------ +# [[ XList class ]] +# An inherited extension to the list object that permits attachment of attributes +#------------------------------------------------------------------------------ +class XList(list, NakedObject): + def __init__(self, list_obj, attributes={}, naked_type='XList'): + list.__init__(self, list_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XList Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + operator overload + # extends XList with one or more other lists (`*other_lists`) + #------------------------------------------------------------------------------ + def __add__(self, *other_lists): + try: + for the_list in other_lists: + # add attributes if it is an XList + if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(the_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # += overload + # extends XList with one other list (`another_list`) + #------------------------------------------------------------------------------ + def __iadd__(self, another_list): + try: + #add attributes if it is an XList + if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(another_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XList (type, attributes, list equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if list(self) == list(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XList Methods + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # XList String Methods + #------------------------------------------------------------------------------ + # [ join method ] (string) + # Concatenate strings in the list and return + # Default separator between string list values is an empty string + # Pass separator character(s) as an argument to the method + #------------------------------------------------------------------------------ + def join(self, separator=""): + return separator.join(self) + + #------------------------------------------------------------------------------ + # [ postfix method ] (list of strings) + # Append a string to each list item string + #------------------------------------------------------------------------------ + def postfix(self, after): + return [ "".join([x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # [ prefix method ] (list of strings) + # Prepend a string to each list item string + #------------------------------------------------------------------------------ + def prefix(self, before): + return [ "".join([before, x]) for x in self ] + + #------------------------------------------------------------------------------ + # [ surround method ] (list of strings) + # Surround each list item string with a before and after string argument passed to the method + #------------------------------------------------------------------------------ + def surround(self, before, after=""): + if after == "": + after = before + return [ "".join([before, x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # XList Numeric Methods + #------------------------------------------------------------------------------ + # [ max method ] (list dependent type, single value) + # return maximum value from the list items + #------------------------------------------------------------------------------ + def max(self): + return max(self) + + #------------------------------------------------------------------------------ + # [ min method ] (list dependent type, single value) + # return minimum value from the list items + #------------------------------------------------------------------------------ + def min(self): + return min(self) + + #------------------------------------------------------------------------------ + # [ sum method ] (list dependent type, single value) + # return the sum of all list items + #------------------------------------------------------------------------------ + def sum(self): + return sum(self) + + #------------------------------------------------------------------------------ + # XList Data Management Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_duplicates method ] (integer) + # returns an integer count of number of duplicate values + #------------------------------------------------------------------------------ + def count_duplicates(self): + return len(self) - len(set(self)) + + #------------------------------------------------------------------------------ + # [ remove_duplicates ] (XList) + # returns a new XList with duplicates removed + #------------------------------------------------------------------------------ + def remove_duplicates(self): + return XList( set(self), self._getAttributeDict() ) + + #------------------------------------------------------------------------------ + # [ difference method ] (set) + # returns a set containing items in XList that are not contained in `another_list` + #------------------------------------------------------------------------------ + def difference(self, another_list): + return set(self) - set(another_list) + + #------------------------------------------------------------------------------ + # [ intersection method ] (set) + # returns a set containing items that are in both XList and `another_list` + #------------------------------------------------------------------------------ + def intersection(self, another_list): + return set(self) & set(another_list) + + #------------------------------------------------------------------------------ + # XList Function Mapping Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ map_to_items method ] (XList) + # returns original XList with modification of each item based upon `mapped_function` + #------------------------------------------------------------------------------ + def map_to_items(self, mapped_function): + # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + for index, item in enumerate(self): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # [ conditional_map_to_items method ] (XList) + # returns original XList with modification of items that meet True condition in + # `conditional_function` with change performed as defined in `mapped_function` + #------------------------------------------------------------------------------ + def conditional_map_to_items(self, conditional_function, mapped_function): + for index, item in enumerate(self): + if conditional_function(item): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # XList Descriptive Stats Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_ci method ] (integer) + # returns an integer count of the number of case-insensitive items that match `test_string` + #------------------------------------------------------------------------------ + def count_ci(self, test_string): + count = 0 + for item in self: + try: + if test_string.lower() in item.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + #------------------------------------------------------------------------------ + # [ random method ] (list) + # returns a single item list with a random element from the original XList + #------------------------------------------------------------------------------ + def random(self): + import random + return random.choice(self) + + #------------------------------------------------------------------------------ + # [ random_sample method ] (list) + # returns a list with one or more random items from the original XList + # number of items determined by the `number_of_items` argument + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + return random.sample(self, number_of_items) + + #------------------------------------------------------------------------------ + # [ shuffle method ] (XList) + # randomly shuffle the contents of the list + #------------------------------------------------------------------------------ + def shuffle(self): + import random + random.shuffle(self) + return self + + #------------------------------------------------------------------------------ + # XList Match Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ wildcard_match method ] (list) + # returns a list of items that match the `wildcard` argument + #------------------------------------------------------------------------------ + def wildcard_match(self, wildcard): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + return [ x for x in self if fnmatchcase(x, wildcard) ] + + #------------------------------------------------------------------------------ + # [ multi_wildcard_match method ] (list) + # returns a list of items that match one or more | separated wildcards passed as string + #------------------------------------------------------------------------------ + def multi_wildcard_match(self, wildcards): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + wc_list = wildcards.split('|') + return_list = [] + for wc in wc_list: + temp_list = [ x for x in self if fnmatchcase(x, wc) ] + for result in temp_list: + return_list.append(result) + return return_list + + #------------------------------------------------------------------------------ + # XList Cast Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ xset method ] (XSet) + # return an XSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xfset method ] (XFSet) + # return an XFSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xtuple method ] (XTuple) + # returns an XTuple with XList item values and XList attributes + #------------------------------------------------------------------------------ + def xtuple(self): + attr_dict = self._getAttributeDict() + return XTuple(tuple(self), attr_dict) + +#------------------------------------------------------------------------------ +# [[ XMaxHeap class ]] +# max heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMaxHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMaxHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None + + # push new object and return the highest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + +#------------------------------------------------------------------------------ +# [[ XMinHeap class ]] +# min heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMinHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMinHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # push new object and return the lowest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None #return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + + +#------------------------------------------------------------------------------ +# [[ XQueue class ]] +# +#------------------------------------------------------------------------------ +from collections import deque +class XQueue(deque, NakedObject): + def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + deque.__init__(self, initial_iterable, max_length) + NakedObject.__init__(self, attributes, naked_type) + + +#------------------------------------------------------------------------------ +# [[ XSet class ]] +# An inherited extension to the mutable set object that permits attribute assignment +# Inherits from set and from NakedObject (see methods in NakedObject at top of this module +#------------------------------------------------------------------------------ +class XSet(set, NakedObject): + def __init__(self, set_obj, attributes={}, naked_type='XSet'): + set.__init__(self, set_obj) + NakedObject.__init__(self, attributes, naked_type) + + # << operator is overloaded to extend the XSet with a second set + def __lshift__(self, another_set): + self.update(another_set) + return self + + # += operator overload to extend the XSet with a second set + def __iadd__(self, another_set): + self.update(another_set) + return self + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict) + + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(self, attr_dict) + +#------------------------------------------------------------------------------ +# [[ XFSet class ]] +# An inherited extension to the immutable frozenset object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +#------------------------------------------------------------------------------ +class XFSet(frozenset): + def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + set_obj = frozenset.__new__(cls, the_set) + if len(attributes) > 0: + for key in attributes: + setattr(set_obj, key, attributes[key]) + setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + return set_obj + + def _getAttributeDict(self): + return self.__dict__ + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict, naked_type="XList") + + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(self, attr_dict, naked_type="XSet") + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XString class ]] +# An inherited extension to the immutable string object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +# Python 2: byte string by default, can cast to normalized UTF-8 with XString().unicode() method +# Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method +#------------------------------------------------------------------------------ +class XString(str): + def __new__(cls, string_text, attributes={}, naked_type='XString'): + str_obj = str.__new__(cls, string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) + return str_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the XString instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + ## TODO: see where + vs. join breakpoint becomes important + def concat(self, *strings): + str_list = [] + for x in strings: + str_list.append(x) + return "".join(str_list) + + # fastest substring search truth test + def contains(self, substring): + return substring in self + + # split the string on one or more delimiters, return list + # if up to two chars, then uses str.split(), if more chars then use re.split + def xsplit(self, split_delimiter): + length = len(split_delimiter) + if length > 2: + import re + split_delimiter = "".join([ '[', split_delimiter, ']' ]) + return re.split(split_delimiter, self) + elif length > 1: + delim2 = split_delimiter[1] + first_list = self.split(split_delimiter[0]) + result_list = [] + for item in first_list: + for subitem in item.split(delim2): + result_list.append(subitem) + return result_list + else: + return self.split(split_delimiter) + + # split the string on one or more characters and return items in set + def xsplit_set(self, split_delimiter): + return set(self.xsplit(split_delimiter)) + + # str begins with substring - faster than str.startswith() + def begins(self, begin_string): + return begin_string in self[0:len(begin_string)] + + # str ends with substring - faster than str.endswith() + def ends(self, end_string): + return end_string in self[-len(end_string):] + + # case sensitive wildcard match on the XString (boolean returned) + def wildcard_match(self, wildcard): + from fnmatch import fnmatchcase + return fnmatchcase(self, wildcard) + + # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + def unicode(self): + from sys import version_info + from unicodedata import normalize + if version_info[0] == 2: + return normalize('NFKD', self.decode('UTF-8')) + else: + return normalize('NFKD', self) + + +# this version works +class XUnicode: + def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + import sys + import unicodedata + norm_text = unicodedata.normalize('NFKD', string_text) + + class XUnicode_2(unicode): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + str_obj = unicode.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + return str_obj + + class XUnicode_3(str): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + str_obj = str.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + return str_obj + + + if sys.version_info[0] == 2: + self.obj = XUnicode_2(norm_text, attributes) + self.norm_unicode = norm_text + self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + elif sys.version_info[0] == 3: + self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + + def __str__(self): + # return self.naked_u_string + return self.obj + + def __repr__(self): + return self.naked_u_string + + def __getattr__(self, the_attribute): + return self.obj.__dict__[the_attribute] + + def __cmp__(self, other_string): + return hash(self.naked_u_string) == hash(other_string) + # TODO: add check for same attributes + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XTuple class ]] +# +#------------------------------------------------------------------------------ +class XTuple(tuple): + def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + tup_obj = tuple.__new__(cls, the_tuple) + if len(attributes) > 0: + for key in attributes: + setattr(tup_obj, key, attributes[key]) + setattr(tup_obj, '_naked_type_', naked_type) + return tup_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +if __name__ == '__main__': + pass + # no = nobj({"version":"1.0.1", "test":"code"}) + # print(no) + # print(no.version) + # print(no.test) + # nl = XList([1, 2, 3, 1, 2, 5], {"version":"1.0.1", "test":"code"}) + # print(nl.count_duplicates()) + # the_list = list(range(5000)) + # nl = XList(the_list) + # nq = XPriorityQueue() + # nq.push('test', 5) + # nq.push('one', 3) + # nq.push('another', 4) + # print(nq.pop()) + # print(nq.pop()) + # print(nq.pop()) + + # nl = XList([2, 2, 2, 'another'], {'p': 'attribute'}) + # print(nl) + # print(nl.count_item(2)) + # nq = XQueue(nl, max_length=2) + # print(nq) + + # xs = XSet({'test', 'true', 'false'}, {'bonus': 'candy', 'test': 'another'}) + # xs += {'bogus', 'yep'} + # print(xs) + + # xd = XDict({'test2': 0, 'is': 1}, {'a': '1', 'b': '2'}) + # ad = {'test': 0, 'is': 2} + # ld = xd.intersection(ad) + # print(ld) + # xd = xd + ad + ld + # print(xd.map_to_vals(pr)) + # print(xd.a) + # print(xd) + # print(xd.a) + # print(xd.min_val()) + # print(xd.conditional_map_to_vals(matcher, resulter)) + + # nl = XList([ 'test.txt', 'bogus.txt', 'test.py', 'another.rb', 'est.doc', 'est.py' ]) + # print(nl.multi_wildcard_match('*.py|*.txt|*.doc')) + + # xstr = XString("Hey! Cœur It's Bengali ব য,\nand here is some more ২") + # ustr = xstr.unicode() + # print(isinstance(ustr, bytes)) + # print(xstr) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/casts.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/casts.py new file mode 100644 index 00000000..32e84319 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/casts.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +# encoding: utf-8 +# tests in test_CASTS.py + +from Naked.toolshed.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString, XTuple +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ nobj ] (NakedObject) +# Cast a dictionary of attributes to a NakedObject with key>attribute mapping +#------------------------------------------------------------------------------ +def nobj(attributes={}): + try: + return NakedObject(attributes) + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xd function ] (XDict) +# Cast a Python dictionary to a XDict +#------------------------------------------------------------------------------ +def xd(dictionary_arg, attributes={}): + try: + return XDict(dictionary_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XDict with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xl function ] (XList) +# Cast a Python list, set, or tuple to a XList +#------------------------------------------------------------------------------ +def xl(list_arg, attributes={}): + try: + return XList(list_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XList with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xq function ] (XQueue) +# Cast a Python list, set, tuple to a XQueue +#------------------------------------------------------------------------------ +def xq(queue_arg, attributes={}): + try: + return XQueue(queue_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XQueue with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xset function ] (XSet) +# Cast a Python set to a XSet +#------------------------------------------------------------------------------ +def xset(set_arg, attributes={}): + try: + return XSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xfset function ] (XFSet) +# Cast a Python set to a XFSet +#------------------------------------------------------------------------------ +def xfset(set_arg, attributes={}): + try: + return XFSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xstr function ] (XString) +# Cast a Python string to a XString +#------------------------------------------------------------------------------ +def xstr(string_arg, attributes={}): + try: + return XString(string_arg, attributes) + except TypeError as te: + raise TypeError("Attempted to cast to a XString with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xt function ] (XTuple) +# Cast a Python list, set, tuple to a XTuple +#------------------------------------------------------------------------------ +def xt(tup_arg, attributes={}): + try: + return XTuple(tup_arg, attributes) + except TypeError as te: + raise TypeError("Attempted to cast to a XTuple with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XTuple with the xt() function (Naked.toolshed.casts.py).") + raise e + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/file.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/file.py new file mode 100644 index 00000000..e9304adb --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/file.py @@ -0,0 +1,376 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ IO class ] +# interface for all local file IO classes +#------------------------------------------------------------------------------ +class IO: + def __init__(self,filepath): + self.filepath = filepath + +#------------------------------------------------------------------------------ +# [ FileWriter class ] +# writes data to local files +#------------------------------------------------------------------------------ +class FileWriter(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ append method ] + # Universal text file writer that appends to existing file using system default text encoding or utf-8 if throws unicode error + # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + #------------------------------------------------------------------------------ + def append(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + with open(self.filepath, 'a') as appender: + appender.write(text) + except UnicodeEncodeError as ue: + self.append_utf8(text) #try writing as utf-8 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ append_utf8 method ] + # Text writer that appends text to existing file with utf-8 encoding + # Tests: test_IO.py :: test_file_utf8_readwrite_append + #------------------------------------------------------------------------------ + def append_utf8(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + import codecs + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + appender.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ gzip method (writer) ] + # writes data to gzip compressed file + # Note: adds .gz extension to filename if user did not specify it in the FileWriter class constructor + # Note: uses compresslevel = 6 as default to balance speed and compression level (which in general is not significantly less than 9) + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_gzip_utf8_readwrite_explicit_decode + #------------------------------------------------------------------------------ + def gzip(self, text, compression_level=6): + try: + import gzip + if not self.filepath.endswith(".gz"): + self.filepath = self.filepath + ".gz" + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(text) + except UnicodeEncodeError as ue: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + import codecs + binary_data = codecs.encode(norm_text, "utf_8") + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write method ] + # Universal text file writer that writes by system default or utf-8 encoded unicode if throws UnicdeEncodeError + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_ascii_readwrite_missing_file, + # test_file_utf8_write_raises_unicodeerror + #------------------------------------------------------------------------------ + def write(self, text): + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + except UnicodeEncodeError as ue: + self.write_utf8(text) # attempt to write with utf-8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_as method ] + # text file writer that uses developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas + #------------------------------------------------------------------------------ + def write_as(self, text, the_encoding=""): + try: + if the_encoding == "": #if the developer did not include the encoding type, raise an exception + raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + f.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_bin method ] + # binary data file writer + # Tests: test_IO.py :: test_file_bin_readwrite + #------------------------------------------------------------------------------ + def write_bin(self, binary_data): + try: + with open(self.filepath, 'wb') as bin_writer: + bin_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ safe_write method ] (boolean) + # Universal text file writer (writes in default encoding unless throws unicode error) that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + #------------------------------------------------------------------------------ + def safe_write(self, text): + import os.path + if not os.path.exists(self.filepath): # if the file does not exist, then can write + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + return True + except UnicodeEncodeError as ue: + self.write_utf8(text) + return True + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + raise e + else: + return False # if file exists, do not write and return False + + #------------------------------------------------------------------------------ + # [ safe_write_bin method ] + # Binary data file writer that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + #------------------------------------------------------------------------------ + def safe_write_bin(self, file_data): + try: + import os.path + if not os.path.exists(self.filepath): + with open(self.filepath, 'wb') as writer: + writer.write(file_data) + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ write_utf8 method ] + # Text file writer with explicit UTF-8 text encoding + # uses filepath from class constructor + # requires text to passed as a method parameter + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + #------------------------------------------------------------------------------ + def write_utf8(self, text): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='w') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + f.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + +#------------------------------------------------------------------------------ +# [ FileReader class ] +# reads data from local files +# filename assigned in constructor (inherited from IO class interface) +#------------------------------------------------------------------------------ +class FileReader(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ read method ] (string) + # Universal text file reader that will read utf-8 encoded unicode or non-unicode text as utf-8 + # returns string or unicode (py3 = string for unicode and non-unicode, py2 = str for non-unicode, unicode for unicode) + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + #------------------------------------------------------------------------------ + def read(self): + try: + return self.read_utf8() #reads everything as unicode in utf8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_bin method ] (binary byte string) + # Universal binary data file reader + # returns file contents in binary mode as binary byte strings + # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + #------------------------------------------------------------------------------ + def read_bin(self): + try: + with open(self.filepath, 'rb') as bin_reader: + data = bin_reader.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_as method ] (string with developer specified text encoding) + # Text file reader with developer specified text encoding + # returns file contents in developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + #------------------------------------------------------------------------------ + def read_as(self, the_encoding): + try: + if the_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + data = f.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines method ] (list of strings) + # Read text from file line by line, uses utf8 encoding by default + # returns list of utf8 encoded file lines as strings + # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + #------------------------------------------------------------------------------ + def readlines(self): + try: + return self.readlines_utf8() # read as utf8 encoded file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_as method ] (list of developer specified encoded strings) + # Read lines from file with developer specified text encoding + # Returns a list of developer specified encoded lines from the file + # Tests: test_IO.py :: + #------------------------------------------------------------------------------ + def readlines_as(self, dev_spec_encoding): + try: + if dev_spec_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + import codecs + with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + data_list = [] + for line in reader: + data_list.append(line) + return data_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_utf8 method ] (list of utf-8 encoded strings) + # Read text from unicode file by line + # Returns list of file unicode text lines as unicode strings + # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + #------------------------------------------------------------------------------ + def readlines_utf8(self): + try: + import codecs + with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + modified_text_list = [] + for line in uni_reader: + import unicodedata + norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + modified_text_list.append(norm_line) + return modified_text_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + raise e + + #------------------------------------------------------------------------------ + # [ read_gzip ] (byte string) + # reads data from a gzip compressed file + # returns the decompressed binary data from the file + # Note: if decompressing unicode file, set encoding="utf-8" + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_read_gzip_missing_file + #------------------------------------------------------------------------------ + def read_gzip(self, encoding="system_default"): + try: + import gzip + with gzip.open(self.filepath, 'rb') as gzip_reader: + file_data = gzip_reader.read() + if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + import codecs + file_data = codecs.decode(file_data, "utf-8") + import unicodedata + norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + return norm_data + else: + return file_data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_utf8 method ] (string) + # read data from a file with explicit UTF-8 encoding + # uses filepath from class constructor + # returns a unicode string containing the file data (unicode in py2, str in py3) + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_append, + # test_file_read_utf8_missing_file + #------------------------------------------------------------------------------ + def read_utf8(self): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='r') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + textstring = f.read() + import unicodedata + norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + return norm_text + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/git.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/git.py new file mode 100644 index 00000000..591cd472 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/git.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# encoding: utf-8 + + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/ink.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/ink.py new file mode 100644 index 00000000..e3dba038 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/ink.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# The Ink Templating System +# A lightweight, fast, flexible text templating system +# Copyright 2014 Christopher Simpkins +# MIT License +#------------------------------------------------------------------------------ +import re + +#------------------------------------------------------------------------------ +# Template class +# A template string class that is inherited from Python str +# Includes metadata about the template: +# odel = opening delimiter +# cdel = closing delimiter +# varlist = inclusive list of all variables in the template text (parsed in constructor) +# Delimiters: +# default = {{variable}} +# assign new opening and closing delimiters as parameters when you make a new Template instance +# `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it +#------------------------------------------------------------------------------ +class Template(str): + def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + obj = str.__new__(cls, template_text) + obj.odel = open_delimiter + obj.cdel = close_delimiter + obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + return obj + + #------------------------------------------------------------------------------ + # [ _make_var_list method ] (list of strings) + # Private method that parses the template string for all variables that match the delimiter pattern + # Returns a list of the variable names as strings + #------------------------------------------------------------------------------ + def _make_var_list(self, template_text, escape_regex=False): + if escape_regex: + open_match_pat = self._escape_regex_special_chars(self.odel) + close_match_pat = self._escape_regex_special_chars(self.cdel) + match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + else: + match_pat = self.odel + r'(.*?)' + self.cdel + var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + + #------------------------------------------------------------------------------ + # [ _escape_regex_special_chars method ] (string) + # Private method that escapes special regex metacharacters + # Returns a string with the escaped character modifications + #------------------------------------------------------------------------------ + def _escape_regex_special_chars(self, test_escape_string): + return re.escape(test_escape_string) + +#------------------------------------------------------------------------------ +# Renderer class +# Render the variable replacements in the ink template using a Python dictionary key argument +# Construct the instace of the Renderer with the Ink template and the dictionary key +# Run the renderer with the render method on the instance (e.g. r.render()) +# Parameters to constructor: +# - template = an Ink Template instance +# - key = a dictionary mapped key = variable name : value = variable replacement data +# - html_entities = encode html entities with HTML escaped characters (default = False = do not encode) +#------------------------------------------------------------------------------ + +class Renderer: + def __init__(self, template, key, html_entities=False): + self.odel = template.odel + self.cdel = template.cdel + self.template = template + self.html_entities = html_entities + self.key_dict = key + + #------------------------------------------------------------------------------ + # [ render method ] (string) + # renders the variable replacements in the Ink template + # returns the rendered template as a string + #------------------------------------------------------------------------------ + def render(self): + # make local variables for the loop below (faster) + local_dict = self.key_dict + local_template = self.template + local_varlist = self.template.varlist + local_odel = self.odel + local_cdel = self.cdel + local_htmlent = self.html_entities + if local_htmlent: + from xml.sax.saxutils import escape #from Python std lib + for key in local_dict: + if key in local_varlist: + value = local_dict[key] + replace_string = local_odel + key + local_cdel + if local_htmlent: + value = escape(value) #xml.sax.saxutils function + local_template = local_template.replace(replace_string, value) + return local_template + + ##TODO : multiple file render method? + + +if __name__ == '__main__': + pass + # template = Template("This is a of the {{test}} of the {{document}} {{type}} and more of the {{test}} {{document}} {{type}}") + # renderer = Renderer(template, {'test': 'ব য', 'document':'testing document', 'type':'of mine', 'bogus': 'bogus test'}) + # print(renderer.render()) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/iter.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/iter.py new file mode 100644 index 00000000..652e721e --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/iter.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import itertools + +#------------------------------------------------------------------------------ +# [ chain_iter method ] (iterable items of type contained in multiple list arguments) +# Generator that returns iterable for each item in the multiple list arguments in sequence +#------------------------------------------------------------------------------ +def chain_iter(self, *lists): + return itertools.chain(*lists) + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/network.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/network.py new file mode 100644 index 00000000..335e8c1b --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/network.py @@ -0,0 +1,351 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import requests +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +#[ HTTP class] +# handle HTTP requests +# Uses the requests external library to handle HTTP requests and response object (available on PyPI) +#------------------------------------------------------------------------------ +class HTTP(): + def __init__(self, url="", request_timeout=10): + self.url = url + self.request_timeout = request_timeout + #------------------------------------------------------------------------------ + # HTTP response properties (assignment occurs with the HTTP request methods) + #------------------------------------------------------------------------------ + self.res = None # assigned with the requests external library response object after a HTTP method call + + #------------------------------------------------------------------------------ + # [ get method ] (string) - + # HTTP GET request - returns text string + # returns data stream read from the URL (string) + # Default timeout = 10 s from class constructor + # Re-throws ConnectionError on failed connection (e.g. no site at URL) + # Test : test_NETWORK.py :: test_http_get, test_http_get_response_change, + # test_http_post_reponse_change, test_http_get_response_check + #------------------------------------------------------------------------------ + def get(self, follow_redirects=True): + try: + response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_data method ] (binary data) + # HTTP GET request, return binary data + # returns data stream with raw binary data + #------------------------------------------------------------------------------ + def get_bin(self): + try: + response = requests.get(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance + return response.content # return binary data instead of text (get() returns text) + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_bin_write_file method ] (boolean) + # open HTTP data stream with GET request, make file with the returned binary data + # file path is passed to the method by the developer + # set suppress_output to True if you want to suppress the d/l status information that is printed to the standard output stream + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_binary + #------------------------------------------------------------------------------ + def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_txt_write_file method ] (boolean) + # open HTTP data stream with GET request, write file with utf-8 encoded text using returned text data + # file path is passed to the method by the developer (default is the base filename in the URL if not specified) + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_text + #------------------------------------------------------------------------------ + def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ head method ] (dictionary of strings) + # HTTP HEAD request + # returns a dictionary of the header strings + # test for a specific header on either the response dictionary or the instance res property + # Usage example: + # content_type = instance.res['content-type'] + # Tests: test_NETWORK.py :: test_http_head + #------------------------------------------------------------------------------ + def head(self): + try: + response = requests.head(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.headers + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ post method ] (string) + # HTTP POST request for text + # returns text from the URL as a string + #------------------------------------------------------------------------------ + def post(self, follow_redirects=True): + try: + response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin method ] (binary data) + # HTTP POST request for binary data + # returns binary data from the URL + #------------------------------------------------------------------------------ + def post_bin(self): + try: + response = requests.post(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.content + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin_write_file method ] (boolean = success of write) + # HTTP POST request, write binary file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ post_txt_write_file method ] (boolean = success of file write) + # HTTP POST request, write utf-8 encoded text file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ response method ] + # getter method for the requests library object that is assigned as a property + # on the HTTP class after a HTTP request method is run (e.g. get()) + # Note: must run one of the HTTP request verbs to assign this property before use of getter (=None by default) + # Tests: test_NETWORK.py :: test_http_get_response_check + #------------------------------------------------------------------------------ + def response(self): + try: + return self.res + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ get_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for GET request + # Note: this method runs its own GET request, does not need to be run separately + # Tests: test_NETWORK.py :: + #------------------------------------------------------------------------------ + def get_status_ok(self): + try: + self.get() #run the get request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for POST request + # Note: method runs its own post method, not necessary to run separately + #------------------------------------------------------------------------------ + def post_status_ok(self): + try: + self.post() #run the post request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + raise e + +if __name__ == '__main__': + pass + #------------------------------------------------------------------------------ + # HTTP GET 1 + #------------------------------------------------------------------------------ + # http = HTTP("http://www.google.com") + # data = http.get() + # print(data) + # from Naked.toolshed.file import FileWriter + # w = FileWriter("testfile.txt") + # w.write_utf8(data) + #------------------------------------------------------------------------------ + # HTTP GET 2 + #------------------------------------------------------------------------------ + # http = HTTP() + # http.url = "http://www.google.com" + # print(http.get()) + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/python.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/python.py new file mode 100644 index 00000000..68d6b4b3 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/python.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# encoding: utf-8 +# tests: test_PYTHON.py + +from sys import version_info + +#------------------------------------------------------------------------------ +# Python Versions +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ py_version function ] (tuple of (major, minor, patch)) +#------------------------------------------------------------------------------ +def py_version(): + return (version_info[0], version_info[1], version_info[2]) + +#------------------------------------------------------------------------------ +# [ py_major_version function ] (integer) +# Return Python interpreter major version number +#------------------------------------------------------------------------------ +def py_major_version(): + return (version_info[0]) + +#------------------------------------------------------------------------------ +# [ py_minor_version function ] (integer) +# Return Python interpreter minor version number +#------------------------------------------------------------------------------ +def py_minor_version(): + return (version_info[1]) + +#------------------------------------------------------------------------------ +# [ py_patch_version function ] (integer) +# Return Python interpreter patch version number +#------------------------------------------------------------------------------ +def py_patch_version(): + return (version_info[2]) + +#------------------------------------------------------------------------------ +# [ is_py2 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 2 +#------------------------------------------------------------------------------ +def is_py2(): + return (version_info[0] == (2)) + +#------------------------------------------------------------------------------ +# [ is_py3 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 3 +#------------------------------------------------------------------------------ +def is_py3(): + return (version_info[0] == (3)) + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/shell.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/shell.py new file mode 100644 index 00000000..4585d428 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/shell.py @@ -0,0 +1,263 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +import sys +import subprocess +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ execute function ] (boolean) +# run a shell command and print std out / std err to terminal +# returns True if exit status = 0 +# returns False if exit status != 0 +#------------------------------------------------------------------------------ +def execute(command): + try: + response = subprocess.call(command, shell=True) + if response == 0: + return True + else: + return False + except subprocess.CalledProcessError as cpe: + try: + sys.stderr.write(cpe.output) + except TypeError as te: + sys.stderr.write(str(cpe.output)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ run function ] (bytes string or False) +# run a shell command +# default = +# success:: print to std out and return the std out string +# error:: print to stderr return False, suppress SystemExit on error to permit ongoing run of calling script +# suppress_stdout = True >> suppress std output stream print (returns string) +# suppress_stderr = True >> suppress std err stream print (returns False) +# suppress_exit_status_call = False >> raise SystemExit with the returned status code +#------------------------------------------------------------------------------ +def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + if not suppress_stdout: + print(response) + return response + except subprocess.CalledProcessError as cpe: + if not suppress_stderr: # error in existing application (non-zero exit status) + try: + sys.stderr.write(cpe.output) + except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + sys.stderr.write(str(cpe.output)) + if not suppress_exit_status_call: + if cpe.returncode: + sys.exit(cpe.returncode) + else: + sys.exit(1) + return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ muterun function ] (NakedObject with attributes for stdout, stderr, exitcode) +# run a shell command and return a response object +# return object attributes : stdout (bytes), stderr (bytes), exitcode (int) +#------------------------------------------------------------------------------ +def muterun(command): + try: + from Naked.toolshed.types import NakedObject + response_obj = NakedObject() + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + response_obj.stdout = response + response_obj.exitcode = 0 + response_obj.stderr = b"" + return response_obj + except subprocess.CalledProcessError as cpe: + response_obj.stdout = b"" + response_obj.stderr = cpe.output + if cpe.returncode: + response_obj.exitcode = cpe.returncode + else: + response_obj.exitcode = 1 + return response_obj + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# RUBY COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_rb function ] (boolean) +# execute a ruby script file in a shell subprocess +#------------------------------------------------------------------------------ +def execute_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return execute(rb_command) # return result of execute() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ run_rb function ] (bytes string or False) +# execute a ruby script file in a shell subprocess, return the output +#------------------------------------------------------------------------------ +def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_rb function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return muterun(rb_command) # return result of muterun() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# NODE.JS COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_js function ] (boolean) +# execute a node.js script file in a shell subprocess +# stdout stream to terminal +# returns True for success (=0) exit status code +# returns False for unsuccessful (!=0) exit status code +#------------------------------------------------------------------------------ +def execute_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return execute(js_command) # return result of execute() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e +#------------------------------------------------------------------------------ +# [ run_js function ] (byte string or False) +# execute a node.js script file in a shell subprocess +# print the standard output to the standard output stream by default +# set suppress_output to True to suppress stream to standard output. String is still returned to calling function +# set suppress_exit_status_call to True to suppress raising sys.exit on failures with shell subprocess exit status code (if available) or 1 if not available +# returns the standard output byte string from the subprocess executable on success +# returns False if the subprocess exits with a non-zero exit code +#------------------------------------------------------------------------------ +def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_js function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return muterun(js_command) # return result of muterun() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ Environment Class ] +# shell environment variables class +# self.env = the environment variable dictionary +# self.vars = the environment variable names list +#------------------------------------------------------------------------------ +class Environment(): + def __init__(self): + self.env = os.environ + self.vars = list(os.environ.keys()) + + #------------------------------------------------------------------------------ + # [ is_var method ] (boolean) + # return boolean for presence of a variable name in the shell environment + #------------------------------------------------------------------------------ + def is_var(self, var_name): + try: + return (var_name in self.vars) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_var method ] (string) + # get the variable value for a variable in the shell environment list + # returns empty string if the variable is not included in the environment variable list + #------------------------------------------------------------------------------ + def get_var(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name] + else: + return "" + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_split_var_list method ] (list of strings) + # return a list of strings split by OS dependent separator from the shell variable assigment string + # if the variable name is not in the environment list, returns an empty list + #------------------------------------------------------------------------------ + def get_split_var_list(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name].split(os.pathsep) + else: + return [] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + raise e + + +if __name__ == '__main__': + pass + # e = Environment() + # pathlist = e.get_split_var_list("PATH") + # for item in pathlist: + # print(item) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/state.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/state.py new file mode 100644 index 00000000..76c7fb8f --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/state.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.settings import debug as DEBUG_FLAG +from Naked.toolshed.system import cwd +import Naked.toolshed.python as py +import sys +import os +import datetime + +class StateObject: + def __init__(self): + now = datetime.datetime.now() + self.py2 = py.is_py2() #truth test Python 2 interpreter + self.py3 = py.is_py3() #truth test Python 3 interpreter + self.py_major = py.py_major_version() #Python major version + self.py_minor = py.py_minor_version() #Python minor version + self.py_patch = py.py_patch_version() #Python patch version + self.os = sys.platform #user operating system + self.cwd = cwd() #current (present) working directory + self.parent_dir = os.pardir + self.default_path = os.defpath + self.user_path = os.path.expanduser("~") + self.string_encoding = sys.getdefaultencoding() + self.file_encoding = sys.getfilesystemencoding() + self.hour = now.hour + self.min = now.minute + self.year = now.year + self.day = now.day + self.month = now.month + self.second = now.second + +if __name__ == '__main__': + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/system.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/system.py new file mode 100644 index 00000000..610a843e --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/system.py @@ -0,0 +1,553 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import os +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY PATHS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filename function ] (string) +# returns file name from a file path (including the file extension) +# Tests: test_SYSTEM.py :: test_sys_filename +#------------------------------------------------------------------------------ +def filename(filepath): + try: + return os.path.basename(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_extension function ] (string) +# returns file extension from a filepath +# Tests: test_SYSTEM.py :: test_sys_file_extension +#------------------------------------------------------------------------------ +def file_extension(filepath): + try: + return os.path.splitext(filepath)[1] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ directory function ] (string) +# returns directory path to the filepath +# Tests: test_SYSTEM.py :: test_sys_dir_path +#------------------------------------------------------------------------------ +def directory(filepath): + try: + return os.path.dirname(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ make_path function ] (string) +# returns OS independent file path from tuple of path components +# Tests: test_SYSTEM.py :: test_sys_make_filepath +#------------------------------------------------------------------------------ +def make_path(*path_list): + try: + return os.path.join(*path_list) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_to_basefile decorator function ] (returns decorated original function) +# concatenates the absolute working directory path to the basename of file in the first parameter of the undecorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile +#------------------------------------------------------------------------------ +def currentdir_to_basefile(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(file_name, *args, **kwargs): + current_directory = os.getcwd() #get current working directory path + full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ currentdir_firstparam decorator function ] (returns decorated original function) +# adds the current working directory as the first function parameter of the decorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg +#------------------------------------------------------------------------------ +def currentdir_firstparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(dir="", *args, **kwargs): + current_directory = os.getcwd() + return func(current_directory, *args, **kwargs) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_lastargument decorator function ] (returns decorated original function) +# adds the current working directory as the last function parameter of the decorated function +# Note: you cannot use other named arguments in the original function with this decorator +# Note: the current directory argument in the last position must be named current_dir +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg +#------------------------------------------------------------------------------ +def currentdir_lastparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(*args, **kwargs): + the_cwd = os.getcwd() + return func(*args, current_dir=the_cwd) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ fullpath function ] (string) +# returns the absolute path to a file that is in the current working directory +# file_name = the basename of the file in the current working directory +# Example usage where test.txt is in working directory: +# filepath = fullpath("test.txt") +# Tests: test_SYSTEM.py :: test_sys_full_path_to_file +#------------------------------------------------------------------------------ +@currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function +def fullpath(file_name): + try: + return file_name + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return absolute path to the file with the fullpath() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ cwd function ] (string) +# returns the current working directory path +# does not need to be called with an argument, the decorator assigns it +# Example usage: +# current_dir = cwd() +# Tests: test_SYSTEM.py :: test_sys_cwd_path +#------------------------------------------------------------------------------ +@currentdir_firstparam +def cwd(dir=""): + try: + return dir + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the current working directory with the cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DIRECTORY WRITES +# +#------------------------------------------------------------------------------ + +## TODO: add tests +#------------------------------------------------------------------------------ +# [ make_dirs function ] (--none--) +# make a new directory path (recursive if multiple levels of depth) if it +# DOES NOT already exist +#------------------------------------------------------------------------------ +def make_dirs(dirpath): + try: + import os + import errno + os.makedirs(dirpath) + return True + except OSError as ose: + if ose.errno != errno.EEXIST: # directory already exists + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + raise ose + else: + return False + except Exception as e: + raise e + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ file_exists function ] (boolean) +# return boolean for existence of file in specified path +# Tests: test_SYSTEM.py :: test_file_exists +#------------------------------------------------------------------------------ +def file_exists(filepath): + try: + if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_file function ] (boolean) +# returns boolean for determination of whether filepath is a file +# Tests: test_SYSTEM.py :: test_sys_is_file, test_sys_is_file_missing_file, +# test_sys_is_file_when_dir +#------------------------------------------------------------------------------ +def is_file(filepath): + try: + return os.path.isfile(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ dir_exists function ] (boolean) +# return boolean for existence of directory in specified path +# Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir +#------------------------------------------------------------------------------ +def dir_exists(dirpath): + try: + if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_dir function ] (boolean) +# returns boolean for determination of whether dirpath is a directory +# Tests: test_SYSTEM.py :: test_sys_dir_is_dir, test_sys_dir_is_dir_when_file, +# test_sys_dir_is_dir_when_missing +#------------------------------------------------------------------------------ +def is_dir(dirpath): + try: + return os.path.isdir(dirpath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE METADATA +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filesize function ] (int) +# return file size in bytes +# Tests: test_SYSTEM.py :: test_sys_meta_file_size +#------------------------------------------------------------------------------ +def file_size(filepath): + try: + return os.path.getsize(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_mod_time function ] (string) +# return the last file modification date/time +# Tests: test_SYSTEM.py :: test_sys_meta_file_mod +#------------------------------------------------------------------------------ +def file_mod_time(filepath): + try: + import time + return time.ctime(os.path.getmtime(filepath)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE LISTINGS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ list_all_files function ] (list) +# returns a list of all files in developer specified directory +# Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir +#------------------------------------------------------------------------------ +def list_all_files(dir): + try: + filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files function ] (list) +# returns a list of files filtered by developer defined file extension in developer defined directory +# Usage example: +# filenames = list_filter_files("py", "tests") +# Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch +#------------------------------------------------------------------------------ +def list_filter_files(extension_filter, dir): + try: + if not extension_filter.startswith("."): + extension_filter = "." + extension_filter + filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_all_files_cwd function ] (list) +# returns a list of all files in the current working directory +# Note: does not require argument, the decorator assigns the cwd +# Usage example: +# file_list = list_all_files_cwd() +# Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd +#------------------------------------------------------------------------------ +@currentdir_firstparam +def list_all_files_cwd(dir=""): + try: + return list_all_files(dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files_cwd function ] (list) +# returns a list of all files in the current working directory filtered by developer specified file extension +# Note: do not specify the second argument, decorator assigns it +# Usage example: +# file_list = list_filter_files_cwd(".py") +# Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch +#------------------------------------------------------------------------------ +@currentdir_lastparam +def list_filter_files_cwd(extension_filter, current_dir=""): + try: + return list_filter_files(extension_filter, current_dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ list_match_files function ] (list) +# returns a list of all files that match the developer specified wildcard match pattern +# can optionally specify return of full path to the files (rather than relative path from cwd) by setting full_path to True +# Usage examples: +# file_list = list_match_files("*.py") +# file_list_fullpath = list_match_files("*.py", True) +# Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath +#------------------------------------------------------------------------------ +def list_match_files(match_pattern, full_path = False): + try: + from glob import glob + filenames = glob(match_pattern) + if full_path: + filenames_fullpath = [] + cwd = os.getcwd() + for name in filenames: + name = os.path.join(cwd, name) #make the full path to the file + filenames_fullpath.append(name) #add to the new list + return filenames_fullpath #then return that list + else: + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# SYMBOLIC LINK TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ is_link function ] (boolean) +# return boolean indicating whether the path is a symbolic link +#------------------------------------------------------------------------------ +def is_link(filepath): + try: + return os.path.islink(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ real_path function ] (string) +# return the real file path pointed to by a symbolic link +#------------------------------------------------------------------------------ +def real_path(filepath): + try: + return os.path.realpath(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DATA STREAMS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ stdout function ] +# print to std output stream +#------------------------------------------------------------------------------ +def stdout(text): + try: + print(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_xnl function ] +# print to std output stream without a newline +#------------------------------------------------------------------------------ +def stdout_xnl(text): + try: + sys.stdout.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_iter function ] +# print items in an iterable to the standard output stream with newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter(iter): + try: + for x in iter: + stdout(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ stdout_iter_xnl function ] +# print items in an iterable to the standard output stream without newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter_xnl(iter): + try: + for x in iter: + stdout_xnl(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr function ] +# print to std error stream +# optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code +#------------------------------------------------------------------------------ +def stderr(text, exit=0): + try: + sys.stderr.write(text + "\n") + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr_xnl function ] +# print to the standard error stream without a newline character after the `text` string +#------------------------------------------------------------------------------ +def stderr_xnl(text, exit=0): + try: + sys.stderr.write(text) + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# APPLICATION CONTROL +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ exit_with_status function ] +# application exit with developer specified exit status code (default = 0) +# use an exit status integer argument +# Tests: test_SYSTEM.py :: test_sys_exit_with_code +#------------------------------------------------------------------------------ +def exit_with_status(exit=0): + raise SystemExit(exit) + +#------------------------------------------------------------------------------ +# [ exit_fail function ] +# application exit with status code 1 +# Tests: test_SYSTEM.py :: test_sys_exit_failure +#------------------------------------------------------------------------------ +def exit_fail(): + raise SystemExit(1) + +#------------------------------------------------------------------------------ +# [ exit_success function] +# application exit with status code 0 +# Tests: test_SYSTEM.py :: test_sys_exit_success +#------------------------------------------------------------------------------ +def exit_success(): + raise SystemExit(0) + + + +if __name__ == '__main__': + pass + # #------------------------------------------------------------------------------ + # # Standard Output Tests + # #------------------------------------------------------------------------------ + # stdout("This is a test") + # for x in range(10): + # stdout_xnl(str(x) + " ") + # list_ten = ['10% ', '20% ', '30% ', '40% ', '50% ', '60% ', '70% ', '80% ', '90% ', '100%'] + # stdout_iter(list_ten) + # #------------------------------------------------------------------------------ + # # Standard Error Tests + # #------------------------------------------------------------------------------ + # stderr("This is a test") + # stderr("This is a test", 1) #exit with status code 1 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/types.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/types.py new file mode 100644 index 00000000..36ac481d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/Naked/toolshed/types.py @@ -0,0 +1,992 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [[ NakedObject class ]] +# A generic Python object +# Assigns object attributes by key name in the dictionary argument to the constructor +# The methods are inherited by other mutable Naked object extension types +# Attribute accessors: hasattr, getattr, setattr, delattr +#------------------------------------------------------------------------------ +class NakedObject(object): + # initialize with an attributes dictionary {attribute_name: attribute_value} + def __init__(self, attributes={}, naked_type='NakedObject'): + if len(attributes) > 0: + for key in attributes: + setattr(self, key, attributes[key]) + setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ _equal_type method ] (boolean) + # returns boolean for type of instance == type of test parameter instance + #------------------------------------------------------------------------------ + def _equal_type(self, other_obj): + return type(self) == type(other_obj) + + #------------------------------------------------------------------------------ + # [ _equal_attributes metod ] (method) + # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + #------------------------------------------------------------------------------ + def _equal_attributes(self, other_obj): + return self.__dict__ == other_obj.__dict__ + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # equality testing based on type and attributes + # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + #------------------------------------------------------------------------------ + def equals(self, other_obj): + return self._equal_type(other_obj) and self._equal_attributes(other_obj) + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + +#------------------------------------------------------------------------------ +# [[ XDict class ]] +# An inherited extension to the dictionary type +#------------------------------------------------------------------------------ +class XDict(dict, NakedObject): + def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + dict.__init__(self, dict_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XDict Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + overload + # overwrites existing keys with key:value pairs from new dictionaries if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __add__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # +- overload + # overwrites existing keys with another_dict (right sided argument) keys if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __iadd__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XDict (type, attributes, dictionary equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if dict(self) == dict(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XDict Value Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ conditional_map_to_vals method ] (XDict) + # returns the original XDict with values that meet True condition in `conditional_function` + # modified as per the `mapped_function` with single value argument call + # Test: test_xdict_conditional_map + #------------------------------------------------------------------------------ + def conditional_map_to_vals(self, conditional_function, mapped_function): + for key, value in self.xitems(): + if conditional_function(key): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ map_to_vals method ] (XDict) + # returns the original XDict with all values modified as per the `mapped_function` + # Test: test_xdict_map_to_vals + #------------------------------------------------------------------------------ + def map_to_vals(self, mapped_function): + # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + for key, value in self.xitems(): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ val_xlist method ] (XList) + # return an XList of the values in the XDict + # Test: test_xdict_val_xlist + #------------------------------------------------------------------------------ + def val_xlist(self): + return XList(self.values(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ max_val method ] (tuple of maximum value and associated key) + # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + #------------------------------------------------------------------------------ + def max_val(self): + return max(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ min_val method ] (tuple of minimum value and associated key) + #------------------------------------------------------------------------------ + def min_val(self): + return min(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ sum_vals method ] (numeric return type dependent upon original value type) + # returns sum of all values in the dictionary + #------------------------------------------------------------------------------ + def sum_vals(self): + return sum(self.values()) + + #------------------------------------------------------------------------------ + # [ val_count method ] (integer) + # returns an integer value for the total count of `value_name` in the dictionary values + # Case sensitive test if comparing strings + # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + #------------------------------------------------------------------------------ + def val_count(self, value_name): + count = 0 + for test_value in self.values(): + if value_name == test_value: + count += 1 + return count + + #------------------------------------------------------------------------------ + # [ value_count_ci method ] (integer) + # returns an integer value for the total count of case insensitive `value_name` + # strings/char in the dictionary values. Can include non-string types (ignores them) + # Test: test_xdict_val_count_ci + #------------------------------------------------------------------------------ + def val_count_ci(self, value_name): + count = 0 + for test_value in self.values(): + try: + if value_name.lower() in test_value.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + + #------------------------------------------------------------------------------ + # XDict Key Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ difference method ] (difference set of keys) + # definition: keys that are included in self, but not in `another_dict` + # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + #------------------------------------------------------------------------------ + def difference(self, another_dict): + return set(self.keys()) - set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ intersection method ] (intersection set of keys) + # definition: keys that are included in both self and `another_dict` + # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + #------------------------------------------------------------------------------ + def intersection(self, another_dict): + return set(self.keys()) & set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ key_xlist method ] (XList) + # returns an XList of the keys in the XDict + # Test: test_xdict_key_xlist + #------------------------------------------------------------------------------ + def key_xlist(self): + return XList(self.keys(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ random method ] (dictionary) + # return new Python dictionary with single, random key:value pair + # Test: test_xdict_key_random + #------------------------------------------------------------------------------ + def random(self): + import random + from Naked.toolshed.python import py_major_version + random_key_list = random.sample(self.keys(), 1) + the_key = random_key_list[0] + return {the_key: self[the_key]} + + #------------------------------------------------------------------------------ + # [ random_sample method ] (dictionary) + # return new Python dictionary with `number_of_items` random key:value pairs + # Test: test_xdict_key_random_sample + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + random_key_list = random.sample(self.keys(), number_of_items) + new_dict = {} + for item in random_key_list: + new_dict[item] = self[item] + return new_dict + + #------------------------------------------------------------------------------ + # [ xitems method ] (tuple) + # Generator method that returns tuples of every key, value in dictionary + # uses appropriate method from Python 2 and 3 interpreters + # Test: test_xdict_xitems + #------------------------------------------------------------------------------ + def xitems(self): + from Naked.toolshed.python import py_major_version + if py_major_version() > 2: + return self.items() + else: + return self.iteritems() + +#------------------------------------------------------------------------------ +# [[ XList class ]] +# An inherited extension to the list object that permits attachment of attributes +#------------------------------------------------------------------------------ +class XList(list, NakedObject): + def __init__(self, list_obj, attributes={}, naked_type='XList'): + list.__init__(self, list_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XList Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + operator overload + # extends XList with one or more other lists (`*other_lists`) + #------------------------------------------------------------------------------ + def __add__(self, *other_lists): + try: + for the_list in other_lists: + # add attributes if it is an XList + if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(the_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # += overload + # extends XList with one other list (`another_list`) + #------------------------------------------------------------------------------ + def __iadd__(self, another_list): + try: + #add attributes if it is an XList + if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(another_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XList (type, attributes, list equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if list(self) == list(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XList Methods + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # XList String Methods + #------------------------------------------------------------------------------ + # [ join method ] (string) + # Concatenate strings in the list and return + # Default separator between string list values is an empty string + # Pass separator character(s) as an argument to the method + #------------------------------------------------------------------------------ + def join(self, separator=""): + return separator.join(self) + + #------------------------------------------------------------------------------ + # [ postfix method ] (list of strings) + # Append a string to each list item string + #------------------------------------------------------------------------------ + def postfix(self, after): + return [ "".join([x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # [ prefix method ] (list of strings) + # Prepend a string to each list item string + #------------------------------------------------------------------------------ + def prefix(self, before): + return [ "".join([before, x]) for x in self ] + + #------------------------------------------------------------------------------ + # [ surround method ] (list of strings) + # Surround each list item string with a before and after string argument passed to the method + #------------------------------------------------------------------------------ + def surround(self, before, after=""): + if after == "": + after = before + return [ "".join([before, x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # XList Numeric Methods + #------------------------------------------------------------------------------ + # [ max method ] (list dependent type, single value) + # return maximum value from the list items + #------------------------------------------------------------------------------ + def max(self): + return max(self) + + #------------------------------------------------------------------------------ + # [ min method ] (list dependent type, single value) + # return minimum value from the list items + #------------------------------------------------------------------------------ + def min(self): + return min(self) + + #------------------------------------------------------------------------------ + # [ sum method ] (list dependent type, single value) + # return the sum of all list items + #------------------------------------------------------------------------------ + def sum(self): + return sum(self) + + #------------------------------------------------------------------------------ + # XList Data Management Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_duplicates method ] (integer) + # returns an integer count of number of duplicate values + #------------------------------------------------------------------------------ + def count_duplicates(self): + return len(self) - len(set(self)) + + #------------------------------------------------------------------------------ + # [ remove_duplicates ] (XList) + # returns a new XList with duplicates removed + #------------------------------------------------------------------------------ + def remove_duplicates(self): + return XList( set(self), self._getAttributeDict() ) + + #------------------------------------------------------------------------------ + # [ difference method ] (set) + # returns a set containing items in XList that are not contained in `another_list` + #------------------------------------------------------------------------------ + def difference(self, another_list): + return set(self) - set(another_list) + + #------------------------------------------------------------------------------ + # [ intersection method ] (set) + # returns a set containing items that are in both XList and `another_list` + #------------------------------------------------------------------------------ + def intersection(self, another_list): + return set(self) & set(another_list) + + #------------------------------------------------------------------------------ + # XList Function Mapping Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ map_to_items method ] (XList) + # returns original XList with modification of each item based upon `mapped_function` + #------------------------------------------------------------------------------ + def map_to_items(self, mapped_function): + # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + for index, item in enumerate(self): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # [ conditional_map_to_items method ] (XList) + # returns original XList with modification of items that meet True condition in + # `conditional_function` with change performed as defined in `mapped_function` + #------------------------------------------------------------------------------ + def conditional_map_to_items(self, conditional_function, mapped_function): + for index, item in enumerate(self): + if conditional_function(item): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # XList Descriptive Stats Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_ci method ] (integer) + # returns an integer count of the number of case-insensitive items that match `test_string` + #------------------------------------------------------------------------------ + def count_ci(self, test_string): + count = 0 + for item in self: + try: + if test_string.lower() in item.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + #------------------------------------------------------------------------------ + # [ random method ] (list) + # returns a single item list with a random element from the original XList + #------------------------------------------------------------------------------ + def random(self): + import random + return random.choice(self) + + #------------------------------------------------------------------------------ + # [ random_sample method ] (list) + # returns a list with one or more random items from the original XList + # number of items determined by the `number_of_items` argument + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + return random.sample(self, number_of_items) + + #------------------------------------------------------------------------------ + # [ shuffle method ] (XList) + # randomly shuffle the contents of the list + #------------------------------------------------------------------------------ + def shuffle(self): + import random + random.shuffle(self) + return self + + #------------------------------------------------------------------------------ + # XList Match Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ wildcard_match method ] (list) + # returns a list of items that match the `wildcard` argument + #------------------------------------------------------------------------------ + def wildcard_match(self, wildcard): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + return [ x for x in self if fnmatchcase(x, wildcard) ] + + #------------------------------------------------------------------------------ + # [ multi_wildcard_match method ] (list) + # returns a list of items that match one or more | separated wildcards passed as string + #------------------------------------------------------------------------------ + def multi_wildcard_match(self, wildcards): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + wc_list = wildcards.split('|') + return_list = [] + for wc in wc_list: + temp_list = [ x for x in self if fnmatchcase(x, wc) ] + for result in temp_list: + return_list.append(result) + return return_list + + #------------------------------------------------------------------------------ + # XList Cast Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ xset method ] (XSet) + # return an XSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xfset method ] (XFSet) + # return an XFSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xtuple method ] (XTuple) + # returns an XTuple with XList item values and XList attributes + #------------------------------------------------------------------------------ + def xtuple(self): + attr_dict = self._getAttributeDict() + return XTuple(tuple(self), attr_dict) + +#------------------------------------------------------------------------------ +# [[ XMaxHeap class ]] +# max heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMaxHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMaxHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None + + # push new object and return the highest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + +#------------------------------------------------------------------------------ +# [[ XMinHeap class ]] +# min heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMinHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMinHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # push new object and return the lowest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None #return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + +#------------------------------------------------------------------------------ +# [[ XQueue class ]] +# +#------------------------------------------------------------------------------ +from collections import deque +class XQueue(deque, NakedObject): + def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + deque.__init__(self, initial_iterable, max_length) + NakedObject.__init__(self, attributes, naked_type) + + +#------------------------------------------------------------------------------ +# [[ XSet class ]] +# An inherited extension to the mutable set object that permits attribute assignment +# Inherits from set and from NakedObject (see methods in NakedObject at top of this module +#------------------------------------------------------------------------------ +class XSet(set, NakedObject): + def __init__(self, set_obj, attributes={}, naked_type='XSet'): + set.__init__(self, set_obj) + NakedObject.__init__(self, attributes, naked_type) + + # += operator overload to extend the XSet with a second set + def __iadd__(self, another_set): + self.update(another_set) + return self + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict) + + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(self, attr_dict) + +#------------------------------------------------------------------------------ +# [[ XFSet class ]] +# An inherited extension to the immutable frozenset object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +#------------------------------------------------------------------------------ +class XFSet(frozenset): + def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + set_obj = frozenset.__new__(cls, the_set) + if len(attributes) > 0: + for key in attributes: + setattr(set_obj, key, attributes[key]) + setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + return set_obj + + def _getAttributeDict(self): + return self.__dict__ + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict, naked_type="XList") + + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(self, attr_dict, naked_type="XSet") + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XString class ]] +# An inherited extension to the immutable string object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +# Python 2: byte string by default, can cast to normalized UTF-8 with XString().unicode() method +# Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method +#------------------------------------------------------------------------------ +class XString(str): + def __new__(cls, string_text, attributes={}, naked_type='XString'): + str_obj = str.__new__(cls, string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) + return str_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the XString instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + ## TODO: see where + vs. join breakpoint becomes important + def concat(self, *strings): + str_list = [] + for x in strings: + str_list.append(x) + return "".join(str_list) + + # fastest substring search truth test + def contains(self, substring): + return substring in self + + # split the string on one or more delimiters, return list + # if up to two chars, then uses str.split(), if more chars then use re.split + def xsplit(self, split_delimiter): + length = len(split_delimiter) + if length > 2: + import re + split_delimiter = "".join([ '[', split_delimiter, ']' ]) + return re.split(split_delimiter, self) + elif length > 1: + delim2 = split_delimiter[1] + first_list = self.split(split_delimiter[0]) + result_list = [] + for item in first_list: + for subitem in item.split(delim2): + result_list.append(subitem) + return result_list + else: + return self.split(split_delimiter) + + # split the string on one or more characters and return items in set + def xsplit_set(self, split_delimiter): + return set(self.xsplit(split_delimiter)) + + # str begins with substring - faster than str.startswith() + def begins(self, begin_string): + return begin_string in self[0:len(begin_string)] + + # str ends with substring - faster than str.endswith() + def ends(self, end_string): + return end_string in self[-len(end_string):] + + # case sensitive wildcard match on the XString (boolean returned) + def wildcard_match(self, wildcard): + from fnmatch import fnmatchcase + return fnmatchcase(self, wildcard) + + # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + def unicode(self): + from sys import version_info + from unicodedata import normalize + if version_info[0] == 2: + return normalize('NFKD', self.decode('UTF-8')) + else: + return normalize('NFKD', self) + + +# this version works +class XUnicode: + def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + import sys + import unicodedata + norm_text = unicodedata.normalize('NFKD', string_text) + + class XUnicode_2(unicode): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + str_obj = unicode.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + return str_obj + + class XUnicode_3(str): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + str_obj = str.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + return str_obj + + + if sys.version_info[0] == 2: + self.obj = XUnicode_2(norm_text, attributes) + self.norm_unicode = norm_text + self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + elif sys.version_info[0] == 3: + self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + + def __str__(self): + # return self.naked_u_string + return self.obj + + def __repr__(self): + return self.naked_u_string + + def __getattr__(self, the_attribute): + return self.obj.__dict__[the_attribute] + + def __cmp__(self, other_string): + return hash(self.naked_u_string) == hash(other_string) + # TODO: add check for same attributes + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XTuple class ]] +# +#------------------------------------------------------------------------------ +class XTuple(tuple): + def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + tup_obj = tuple.__new__(cls, the_tuple) + if len(attributes) > 0: + for key in attributes: + setattr(tup_obj, key, attributes[key]) + setattr(tup_obj, '_naked_type_', naked_type) + return tup_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +if __name__ == '__main__': + pass + # no = nobj({"version":"1.0.1", "test":"code"}) + # print(no) + # print(no.version) + # print(no.test) + # nl = XList([1, 2, 3, 1, 2, 5], {"version":"1.0.1", "test":"code"}) + # print(nl.count_duplicates()) + # the_list = list(range(5000)) + # nl = XList(the_list) + # nq = XPriorityQueue() + # nq.push('test', 5) + # nq.push('one', 3) + # nq.push('another', 4) + # print(nq.pop()) + # print(nq.pop()) + # print(nq.pop()) + + # nl = XList([2, 2, 2, 'another'], {'p': 'attribute'}) + # print(nl) + # print(nl.count_item(2)) + # nq = XQueue(nl, max_length=2) + # print(nq) + + # xs = XSet({'test', 'true', 'false'}, {'bonus': 'candy', 'test': 'another'}) + # xs += {'bogus', 'yep'} + # print(xs) + + # xd = XDict({'test2': 0, 'is': 1}, {'a': '1', 'b': '2'}) + # ad = {'test': 0, 'is': 2} + # ld = xd.intersection(ad) + # print(ld) + # xd = xd + ad + ld + # print(xd.map_to_vals(pr)) + # print(xd.a) + # print(xd) + # print(xd.a) + # print(xd.min_val()) + # print(xd.conditional_map_to_vals(matcher, resulter)) + + # nl = XList([ 'test.txt', 'bogus.txt', 'test.py', 'another.rb', 'est.doc', 'est.py' ]) + # print(nl.multi_wildcard_match('*.py|*.txt|*.doc')) + + # xstr = XString("Hey! Cœur It's Bengali ব য,\nand here is some more ২") + # ustr = xstr.unicode() + # print(isinstance(ustr, bytes)) + # print(xstr) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/INSTALLER b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/INSTALLER similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/INSTALLER rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/INSTALLER diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE new file mode 100644 index 00000000..e8f88054 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2017-2019 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/METADATA b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/METADATA new file mode 100644 index 00000000..27833de2 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/METADATA @@ -0,0 +1,40 @@ +Metadata-Version: 2.1 +Name: PyYAML +Version: 5.3 +Summary: YAML parser and emitter for Python +Home-page: https://github.com/yaml/pyyaml +Author: Kirill Simonov +Author-email: xi@resolvent.net +License: MIT +Download-URL: https://pypi.org/project/PyYAML/ +Platform: Any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Cython +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Processing :: Markup + +YAML is a data serialization format designed for human readability +and interaction with scripting languages. PyYAML is a YAML parser +and emitter for Python. + +PyYAML features a complete YAML 1.1 parser, Unicode support, pickle +support, capable extension API, and sensible error messages. PyYAML +supports standard YAML tags and provides Python-specific tags that +allow to represent an arbitrary Python object. + +PyYAML is applicable for a broad range of tasks from complex +configuration files to object serialization and persistence. + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/RECORD new file mode 100644 index 00000000..7f6f07e9 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/RECORD @@ -0,0 +1,40 @@ +PyYAML-5.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +PyYAML-5.3.dist-info/LICENSE,sha256=oq25yVm3l0lKDvgL32DiLbJ0nuPgwJCFVuPrVI-WfFY,1101 +PyYAML-5.3.dist-info/METADATA,sha256=qeUmOwAa8JaIGvO7rR36WWVTAyA6OjLbv80lirmn4KI,1688 +PyYAML-5.3.dist-info/RECORD,, +PyYAML-5.3.dist-info/WHEEL,sha256=xhTAlQlEzHPebOMFd-mhU4DM_uRYSil3AJ61fHfeWHQ,102 +_yaml.cp37-win32.pyd,sha256=F0-gY63-wzdqJ9iYq4g-79svSHDp8bszK0-2jO4Gz3M,231424 +yaml/__init__.py,sha256=d28oT0Lc_XTrMwdoyG_fnl7KLfZzPHAbewmELDwVkyY,13168 +yaml/__pycache__/__init__.cpython-37.pyc,sha256=rCcebvcUhx0FVRO1KRSCSo-ALdzIYtjyTD62Tk52eJE,11721 +yaml/__pycache__/composer.cpython-37.pyc,sha256=cOpEfSk4Fq-jFkPsieHN2kJcmcr2Vc6D8NVvYTPOE1o,3484 +yaml/__pycache__/constructor.cpython-37.pyc,sha256=06qatUtXJKnpfjaT2pfJc-3XmcAlH_-6afhzOQo6Wsw,20074 +yaml/__pycache__/cyaml.cpython-37.pyc,sha256=gyoH1zVnyV6BTcnDi4eM1HPYVt5XE-D4S4HZELEo4x4,3649 +yaml/__pycache__/dumper.cpython-37.pyc,sha256=s3rc-ZaF4jFpa-1Oq4ZZVMKaxaWmyDbgvnUYVMjvdyI,2024 +yaml/__pycache__/emitter.cpython-37.pyc,sha256=yn8qKLXPiFVHPkalKUOxvqt6c1GDpvDv64flUyA-fQw,25274 +yaml/__pycache__/error.cpython-37.pyc,sha256=3nFo2OVqw39xQ2n8Xlb8YVDFtIk6QYnrQseaqzWqxgQ,2235 +yaml/__pycache__/events.cpython-37.pyc,sha256=fd9PwYCVVRyLfNWoWJlFJTKKxwxqHJ9ptZz28J4pHwo,4001 +yaml/__pycache__/loader.cpython-37.pyc,sha256=zMnbLaDnYxc_9DW3ath8WgEme7Cp8hYMWSVbgoYOD-0,2233 +yaml/__pycache__/nodes.cpython-37.pyc,sha256=O1LH_BDmPYD52se6KfoBWlee7CPGtKI-kMv75EgnC00,1679 +yaml/__pycache__/parser.cpython-37.pyc,sha256=mysaVAzDSPgpwNozJAHCBAIF2_ZwEkFAx5FDru0Ajvs,11829 +yaml/__pycache__/reader.cpython-37.pyc,sha256=KNWgMf-RIz7QPmDwNDd-5d_ZO5ZIQbH66os3I0WMAlk,4442 +yaml/__pycache__/representer.cpython-37.pyc,sha256=TuoUxqnBNU6w_RcE4nGkudplMHg0XvPc_PzOiXu5fEI,10065 +yaml/__pycache__/resolver.cpython-37.pyc,sha256=eUi337rMdeLYgfEULvNcDQw9OvF-rXXnPKDA-p5Sroc,5415 +yaml/__pycache__/scanner.cpython-37.pyc,sha256=zkmXD0FYIfQcr6rRNPsVvrKbNhpYNdgrXkDH-k1lNMw,25775 +yaml/__pycache__/serializer.cpython-37.pyc,sha256=7V9jHBaequ3D4yC7q8Zg1EOOwnmBIlZGKzdbkJO04aY,3314 +yaml/__pycache__/tokens.cpython-37.pyc,sha256=PEcIbV522wfYzKavUEos4QkZfFWxAhLmpF_9mmkZgjU,5178 +yaml/composer.py,sha256=_Ko30Wr6eDWUeUpauUGT3Lcg9QPBnOPVlTnIMRGJ9FM,4883 +yaml/constructor.py,sha256=4Pd2pssgKUMGLdS_kW6A4SwC7q0T13-sBrATvNQZCZ0,27321 +yaml/cyaml.py,sha256=LiMkvchNonfoy1F6ec9L2BiUz3r0bwF4hympASJX1Ic,3846 +yaml/dumper.py,sha256=PLctZlYwZLp7XmeUdwRuv4nYOZ2UBnDIUy8-lKfLF-o,2837 +yaml/emitter.py,sha256=jghtaU7eFwg31bG0B7RZea_29Adi9CKmXq_QjgQpCkQ,43006 +yaml/error.py,sha256=Ah9z-toHJUbE9j-M8YpxgSRM5CgLCcwVzJgLLRF2Fxo,2533 +yaml/events.py,sha256=50_TksgQiE4up-lKo_V-nBy-tAIxkIPQxY5qDhKCeHw,2445 +yaml/loader.py,sha256=UVa-zIqmkFSCIYq_PgSGm4NSJttHY2Rf_zQ4_b1fHN0,2061 +yaml/nodes.py,sha256=gPKNj8pKCdh2d4gr3gIYINnPOaOxGhJAUiYhGRnPE84,1440 +yaml/parser.py,sha256=ilWp5vvgoHFGzvOZDItFoGjD6D42nhlZrZyjAwa0oJo,25495 +yaml/reader.py,sha256=0dmzirOiDG4Xo41RnuQS7K9rkY3xjHiVasfDMNTqCNw,6794 +yaml/representer.py,sha256=82UM3ZxUQKqsKAF4ltWOxCS6jGPIFtXpGs7mvqyv4Xs,14184 +yaml/resolver.py,sha256=DJCjpQr8YQCEYYjKEYqTl0GrsZil2H4aFOI9b0Oe-U4,8970 +yaml/scanner.py,sha256=KeQIKGNlSyPE8QDwionHxy9CgbqE5teJEz05FR9-nAg,51277 +yaml/serializer.py,sha256=ChuFgmhU01hj4xgI8GaKv6vfM2Bujwa9i7d2FAHj7cA,4165 +yaml/tokens.py,sha256=lTQIzSVw8Mg9wv459-TjiOQe6wVziqaRlqX2_89rp54,2573 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL new file mode 100644 index 00000000..938295e1 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: false +Tag: cp37-cp37m-win32 + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/_yaml.cp37-win32.pyd b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/_yaml.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..1107b4aa53e60b6adeaff040b7eef1e23cf334ce GIT binary patch literal 231424 zcmd?S4SW>Uxj#OeEXfiUW`U?tQG!NA14s>OU?U`iT_O@pc-f#3f>*^zQ7Oz|R0wNl z6PS#v+*Vurs%`D9^w$@wUJYtBLCOZjik540E4Hbo*NI6rw%nRv>i)jZb7p3DlYqR~ z|L6bt|M&BmotZOd&Uwyrp7Xq&=bS0OeutDUNs=2!JT6JiIMc6~|BwBb>yo4~6Q3I+ zJw5WZNzJZ>uT5H7d+WyB^&9TEWy1}(<=%M1?YG~dIbm>0I98Q<|=sfthBV8&klB6AHrAreAKTEoQ z0?&(+?g`FyfbVF(Y0AxY3Lbv*17sq&sI3;<_B*+fw0hcxn{H5UK>brG6>Xb_Q*Ua) z#UQ6?BAfK!<#;|F`6lCxwk7|HC8=fFEo*MQX`>`%(}VSRPDKTWi;i)%Zwha#~U(Kudz24I7~Q*1sJK(3YR=l zYVs6E_No2(yDLKGdOXzjcp6&N5vz>9RKHx+@DHUj6hG}gDcxuEX?xraaizpiJ!=cs zN+EN*$0hw;t`8j6_IUMrcQZ&`S|h&|%%#66HL;8lR9BGb0H+yr;!g7 zbf4AKn%7&@fm`bG?omyx1#jl{74^#V-lAL{ysC9f>^{%RChq0#akxh=>v?8(T0u+0 zo64<5wI}MGrI&mCuim-xMQV`$txXp;O_<&EYWUAB;r_51l%IJusQr0PYez(GVS?jy?MOPVB@eE%v?FeH%vF-)k~U--{at6rkX zhD`IH@i^0=93if2EO8sJM6Uz2&I4Ik`ChGDY_=rwy^kUr{-I_WmlLrTyxlz}BrfA` zp?;$skm=O}#?|hIeX6_QAKjix@t{{%`v|n3@cVM)5uE*7O!e$&z^sS{dT?}Bm_Gr7 zG`94B&>LEmt@=a&uf6Qi?{sT1Pb@HicYvTCYh3BoK7Vz#+;Ben*$8y%fnI0GEE^%Z z4><7_v~cg~!O1*c^xzC5a2VZa1bX$L#|Y%;_1+pi=wk|rWe|Cji9kVMAo0iu z^d)YXNU27fcIXWH0o8b_jH{@ABRE0i|2<(jI3*U$C1k{cdE&$pD>=u~Sa7;{#0()8 zoI-cWIo8F3%SDcr;DKe5fauG5aHZB#TuTC34=%T!5Z){G;Cgh*2zo+q)mqOKJiA;EZsxbR z@H+9tMoEs&jn~Yu&iG(@rzXZS&}?+@1VL&Ee0(u%dH&Y;qAI*0sZopcRPyLe-ghHZRUlIRZ z_hJ->>qQmu)2Phuxl}y!A@Q1ELX;g$QQUaDPyf73HA0=)1>*>VYZZiXeU9Wi5757c z^E)`wa837g7WhIHS$e=z9lwA88H5iYDMn3`fb|&btw6lEsD8P5M_RfsiKB}0b`hxq z!+|!voJytPE4VJ63;k_aeZUQ%Z5@oo36CBYD6xzzlz9wIAh~?%LT|y_tP5DupLIkC z{3%1k^VR>b#IthaAmwn0q5AO3GJa)Eio7Pd?sH!B*)NiI(D1f;z9r7$N=6k+rG$KP zq>v*;<p?HePj`*J%99YGBY_VgLPgX0ANWm?XUmhRXI?C538B?^7szDE zl$4`!2Pc<_rwhet9-aJ+58_|B(72znKx9qUIkUN96bOSaNpNv4^$$XvBp3WB-ikHe zhkyFTIG?zp^2C)bG?L$Y8joU)kBKa}dfd5s)VfN}-Ga1OW3%-n*7$;RMdi>hIrjnF z#~Sx=I$gCnS1s06a_&P&i!~l}^0YfwR1W?8jh*;cN|vly17eAAn#O66uk`2`@|8*# z@3VZR+eGEHM7)rgvBnNu&@aa2i7U!WKXdP=JmiO$r&bZ>50Gi7JO!D^k#jL>_26nf zc$1K)QVZR$v?Sj=%7T}Xv``OLjG(8r;WWB0vqT_uAm#cm%EetQh-3t1gB0cdxAHz} z<=x47sasj35(wPgRyOK4D)OtG?FIag2qO;_M%`@XYQZJYwOZ#sq=G0#=f1VFP$wbF zReB?J+z5JJ8^)i`U20{r&<+_+-NiDz0~bSN`0}A_`t!#YVJ8+W!#_^RV=K|oM&qOO z^#9}IB+*`|5glkS{YZ@~*pnVFPUO8mIfuP;WK@*@kE4D0O-ME8O+z`(RCv zYuG0TS}PXEPg@FU279hs7Af)5NW76M&<1O4L=A~tV_CM*nxEmyrnlk6J9ekv!((L%qsecEuMz3`-c9XGa^ipxE7p?emRb0&unce@u zXfNFBo(V zzd{BcZ+{<+o;v@YC?DE5lN4*m34a*|@v&;L_#L;Ios`BX+3%png*l^-m>wL6Y95uwzLpB}#m^|!UC>fvReHTu zsgWuB0tXood8~x%PI+vxkB2VWU7X9Epk+?3S!G^iy&~E;xP9y_sM21H5a{Y!?L}?| z3JR__f_18&v4~stj{1b(GZsYqAbo<9V?lRrdOG}BIRxSgftY9B6NrJGZ0ui~xi(&b zLR=v@Jj@TzAjFW5^7W8e$v4!2yN%F7)Ujy2QC}Aiu8#-n;)|9Fj1oI&%EGKeCO4^j z8fFSQiZI{MOzfz8qCMZx3_q9D?F;|8uK*JRz0bRGE6;lw^dNAbz8gRU4$EWV0S+!i z)8HT$-GQWodZ141p;I4SR>H+s=q1w(qPku7KHtusVdIgQ`-u4w%6chCy6 z!Fq>!XmI}s`n&M-q4amH^;RNA2%!I`Rz`t>I~ zE_R7=(VBi>z7ZHGEz?5__4@VtsyaQm^dyE^qPXaM7d+0&4uiuBzUmTaT}Nv6J~*Wq>TdZ69HnBaLJ zC4n)MFm@Oin>++#-}us^M8w;rrWr%>FHmHkU@fy#+GRd$`s-ma0F$$j9x%zmmh<0 zs@dcwL3xsdGrT-(9BWffLR!puTd?b7c?bYW9#&mK*=e%)xb?Be*w!Dck4)`2j($9$5JN|Jobzsdd zToW=kudtDLjnVitKsLVd0{;EGl?m*R(h4PIlu_pK-~TX@l{2-L9RF^$E7tg3+!9+8 z<`c{;6Eu#_A*18l>?~k{vFfkV>X*7Up0?H%GM_s@*+_HBASJx|Wvza*6oOq=0v8e9 zrzG>{#Wq-Phs^ft?VI1mH`RsAI)<6%>0U&!?v3(VcgVcaE>_uT1Q#}W5S27KWR6A< zkyR!nS3_KG_yACb`!Aq}xvUj)h4cgk;K@|=hQczJy0Wk=O|5FGNDm*$Rf@w$Mk@aB zkMOs~O=scY|_a_{h8JIk*f{!idL}(1Los_r z&1;COYr_50{v|bKgv`Q3P2v6(s68uW&gdsn^HA;K{(F$-Mf;P}s*yG-WFGn?Dc=^P z0Z(noX;TPu8Am7=V~#Mktf|6v3_PVJ@RY`QN>AX)N)UKL$zIlVtdi%bt87cJ?2D^n zrcj&(DrWsls`y5N?85z*0E^>7=3*AMRu5c=wDBQxc5>Pz!t7=!ybfkJt2uW2Wg0pU zFmkLSW+y*{pLRp?!;4TpUbsEEhtESA@?D>tmaE(v?jNb#6z(6b)P(!9l$!4fmg~oEh%ltYnA#XDc#>nUWRm zFIGl``&X;C5v7c_x^V$2`bdgP=S&PET|kx zI?sa2p`@{qeF`vnnP5lM%|Zo;)jo{5bCxQ#dvFC+Kv?;OA;NhM;} zZ|m;_yB%!ceH#(1%-@uQ$7|rd|39`INOq=th26tR!h5t;t34%lDr*TAumbY7)<}O5J7#S^#7jS?J4yC0i`C>zg6Rj(Esbh(f^EuzZ9Nv zPpC?--fuib6rz2YqpJtB*^(S70=A7{cGMsrD482yC!Z)f4k4L6Ov1RfJ#k*cMM<4R z>Tt>Vkdy9vG2iH4Tp87NAfY0v(Uf$B+4rv9+%sbc$)mYg#~*jG1+b_V!A?fZcyok}rA=D!kkhocjAH{XJ|hflg%kGPH9t>(n^-TATfy?E5xkzNrkoxB8IW}4hI z)B{HKes;eGJ^31y74?P<21y?4ZWGSfd2Nn2c3xYqv0u}u*^_|)qDwELb~izZe9Kj_ zg#4m!VHmR>E=P(%YB8GJlVaKvbi%KT+NnJsp=53QsJX5%_U5sz*3)H zI$1A;KQ@+5F40)&1bQo0>fR2+z(LEn-->=rwFwxO1qoQ5hWi zXmcw=gJ`0&!x_93zHDT0hm{XtYCtM@P4v-Fhk3^2RV&PY>`$U`9=|!H@}Cm_OXYg+ z^Y|Q=>jAPtSo%uY8208i&@dxd3Tt}axf4}w^T^sbT zo{2I4C@w-3=1+OF19@`fPe?JwkVMe94DwmHXeuhhjmEHpuwCck(ab;&rsl}`709KB zBsJ)K7$QQ8$JNyak5EBzevK$n(4{(I2yt!uqeWcGY9_39qAJmIf~JyvU_?{YO;-8L z{;cwu1FByd!q6_V%U2OSVY4(Y#A0KDgMF6F!Cs0M4a30#z61-KKe@_gVF84Dcm?kQ z*zJS)7bwu;U(^urFN=HGp&Ut6mlz+m@;T06S?|Z}ku_(7)g0EmlCsvgpGI^(N8zDU z5TqRFu^2D+Mu^!j6bs_x%!Sh%iN#XbJ|=Af1Lj%0%7Ao7u_{K4OAGs?8wD8qeN1LU z1_%q+LOm-%46q~<~l!Ddohf9B=tr}D>7of%Xec#=14Xws6sZQgvBrWAiAIt z6#J+E)LKkbg;IE0Z*rW07FIo#qs>WEvqUgCHLOMeXY0o~OF{_sT#FSLaMkv}TWhNS z1)g;P(pq0;A}}EGB$zV5jxO-&%X$I4Ufv^*O%smf(0WV}IKG*tEWoksFkHwZ;FItE zQmO;lUU-u!=F7&zfs6$c#EN;^Or94QNZ(Dq1^E6pjwh36MGJ{0sIYP*hkz(YKP+sL zil%RH7tP!>p{NAs>o;W=-GKAmo4iFeil=C*F#e+@Bm9A$4HLz>jb5zXFe^+yGiDyX zyJ^IW@_dmu>)hMNcHh#po2U22Zy$>%C2^XnTd0@!Hc8zJ@Q9WcQML)Vru9N|2W69= zk+!?&B`&oDFLFvsQOPOD;2@4YDyLJEYhQAj%rQmfz4N;=!F|!on4%1k+am(3NXDXt zO|GI`Wp&X=Wo6N5WqDDSvb2Z{tGi(CEihWcg{cPLm6VWd@Lkv>MOu{HqB+WhqFG8# z(G(@Ss9NzAZBe{M7XXpPio0mFTBU9AjVCTgQDGRHE_rMT(JXWCz+qfnJ%Mh)yxn?b zo_<}9IxgmdbKRB_%sOH&Oi!ew&{#RV%N&8F2@m2Ax&T#V>_J(QzTDHiABhw)7BbhA zp|#6Q7 zE(+du?2ChRKX_SGn@EJTre_Dl=`fwJI?5~%73zTwBHerhUq{Qp{!Jb{oog{{B~!NZ z9Hcy%cAi6=r(NXfeuJB<2ihpldoWyS98ysSINN>{B*r1nm^Y-$9I9&E6j) zvf6CdsXo*tqf)TjaN+rKLko~2)^`z)%aS9%By8WIm^&8HHylw|}t>;NE?HmxHuxVKy;PqveKqATq(9M=SHemrEVKJkx?Z0pH`w z1w+zyDr1pWn4@IXN^Xpu4l*K`-;Y-2qP*Eoc{7H*`?!)T(&UB?;DhiZH@wAHX*=Zx zVp!;dG|1Pqkojq|1OEf?a`KC#$p!ApQqRzW>(k&-(t=Ar(}D}rFi+ogKi;+hxdMP( z<^TfY5`C8}U>;Ypt+W-~Nz2elJJoB^8Qc*HW>!(;sS+@T4YNKBmcR>oU=IRKvxN@W z&{CI~9)r@>oeq}F!z&ti!6@&m;339xrpyx!v_Ul(fSCCc6cNh|*65PvIJlGFde%YG zT0DRz2wmPE7?2yPVX2^vBuC{)1#TdZJ&?z6b99ejEen$aR~zLA!!xtg5-e@G3VPg3 zBhXfuqgET`ChI7jq@#4Qei99IRG8oVJ@I_jQ9hvZ%gw#6+<3t3o*WIdBikVy2XQ35 z(#fynkc@biUpZ(5+VflW@0zi#rEU1130M3Nw5Dn@p>JGcEr z`p@t>T8R>%dD#toyL-g*V60NnXgP8jE&%459fDtAyyhZ>$LrlRUdPdMK^`gN^$1bZ z;PjnxZTMn9DPUHHiCx%t!Oh=V7kEO~bWlN}X2=G`4RnD{&x50VP zY$_ZX9PYw|!>Zi(AQ>%|`XvX%a3L7P?4Ph+EuFgpufRvmR=>MHp`| z#t$*_obkHXl@$*hqM@2Ja=R(02XcC}QjPI?9Xdr0qf^w8$W2+hNynvuTg8L4(m2pG zH?8P#u>76sJo%Y4OQWT#fQCaB8V)%a6)D~6RC#bA>URdW<%$0Mfwu;Yu?AiiQ%W5T zuE>uN{$*4j);^6Z(~|L!Lb@LuB%Cnia{xX0@D6F8x>US!6l#Aq@k$dB8kX51pl6wv zbXNp4LciN<{xJqIptcRx99f+-Tk#OI!Ayc2W3bUhY)kh@M{$j-9p<;Vkb{<1 z>gc2$s8BLDAFGBMt^rHSt>T407|sw5xQEGyAb;kbXp4)?+Y%3x?pY+6-+j^{-Exqm zy*@J?69*$^2J5zb8B`UXmHS0&1>dK-*VuKd4*+!dE`oLbm@!Jewol*UL9n{p--@*+ zM71O3$UQ_cCoUSt;58u{-F!u&k=RjUP8*IP^-X5OgNykw~C%x+o(WN{@ z7bOqT5TUN3t2i2>6yi$4*8&3Ibp4II8h%MVOZN-eS?urIlBTC? ze%F=^;R3R~FW9F-&?%-$&^I(VvW);)fI&e`2+T!?(S0Idm$X?#>pq4PqIDCo-)w(n zbJPjeo7$TvRQG|nm@=LCG=PiX!)mfN13hfgl)8>L8aJVsL*FG)&*DFXq9nb}W7e|R z&nDS9g`|66U{^C7k7E6fZ`N4#tOx?uV0=jJK^Fj@T`{jMBl z9IPzu{Dm`Y-XU4W!slOSLCmtNg9ULL)kkar7Q|D46Z!}<2IwP?;gBa+#pQ)2jl4V3hOKdyB;yK-00l+i>aESvzF50s$sd69gSMq&` zDpe~6^R1>+=@0ZpTpcirT1W_s&2lU$Y4I*cGA3~`!lqtN%MSL?RWK*69ya@5ipQ6j zf5$%+*o`w(v}BoU`~|$+&$0o%9FdV} ziLrLo|8X!+x;UmqKue$R9VJDH70fsDA12 z)&H`<+?3p|Z-;HHGNPp4shmo!m_XD#Bihfd}?QL!Fi7v&Pne6sH`#YI_W=XrwY=2AOP zGy5l>7H-TuI}f`tN7;ESAEwA7*?C@|a^Cj|(l4Ws3z+qKIhIyQm};<91BW(PFW?|_ zaJoQ;P!9gteR1m4gR?c5n0gpxFV#WRI*j@B-Czg^B!N^U#^#3Ik08W9{=^wxHvk+8 zv5^~C8WYE!%D(ie6e*ZC)pB)AQx&La)70CMHchQ$l+|LsfW>?z zUqCQT;|ua^AplX1Oyt{l)eAW05Q!ronzF1!*v^Pdq(s=r|2vwtLz5$a#hE3D1pgOe zq7!_1Vgmdh;sG)hylpHygjLSrLICvw`Kx#+0I;37Axr)TbOu=8qO;>~Gbk&yd62(t z<8bMKZ3U%M(c~6cL^stw+E?pSpttBEx#90P7nZn0_-1r2=4l3-x?kVxaH1Eefy)l< zO}hyHfMTxG^Tw+6`m#e59GZ~Jt;e%I%hm{8&<9IhMm=<5TJwb^Buz33li4VP>nOOe zs}^1{i;`qs^d*ujMKa9@$xKlqc@~mw%CajFPjbn-R==>}?dJ2)csUU0X_9BP$&u+u z2WlD?Lsba(uT+~Z`iqd+BE?y3CK!PwFA8cZH5t9`n4(;ddkNXnF?J9ApijPQGNrW9{aqwWiLhtcobbGomkSMdCjR?|Br7Z1x1 z880JmN!}dzy{3fm&US=%B)xG?t2u6p4>?~(-V(fK<=pP--o5=StH&{8PIw@PD0&t1 zx9DUr0@fJbU-iLES zNZz z4VGj0eq#0I&1f;(ls^R7u@q@|7+3Jovd=yqXddK~vK>-cfEd7~Z#;c%ddPg|`wnoc z0i2)|>aIoLQ*})qqaMK@OHZ0+A%3AHglCRcr?9PfA^cL&`DtKQ(bCVrs~A?;juvnv zj@@vWVMg$TdWIOj=oxbN(j=7J5XKePM$(@vj61am9+}Nb0D~YTxc*O6EyhMRYXV8n zZWGT)9mr;NAn92po(-!LaGtKq@L15uDSGIs&tX+HTUJ%GGjv5t!b9K811`w}C;*X} zr5_;QW?=t@3CZqr)BS6Qz@`#SGj*w#5M`- zp~D+gIpx*v)m$!o4iQ1Mn76!}-fe3tp&1EJ5jyTxBs9T8eqg(YSX21{(dq+Ms}DG> z7Af5sP8GwrKD*9FX*A?8!3A-)huhvlZEwNA+JobT3e)p~)Alc6=%PO6m1iP9!w?Vb zaX45P6=V^~>72nR-{XL^2RyU_PkD=Ce#$!tP$*H!(98)=x<|BekJZMc0!1DIK)7{D zi|xMJ0q0cbR*6~4+WS}@L~i-lzio4ahJ#4zDhD=5tG|f)DDXtMFiUQDh!NQqE|k>E zAU=kj#(MTS2caGGYWbnPG{1SMdrmUVCC~Vn?&s+h_Er9zUrC*y90gei{%4dwVFaEg zrrFH%mWSET=Iy%VZ}E6Czf385Cqu(UFBT2a1IAAqdXP3+Zl?S zuE(&7Ihn9hpg2EKE=|xUvwxbvy~JwCYLr1d)X@q6xcHcgYjTDVaWg_(Ci|9h3<9YU780|36IA$+LM5?k77q@+9Ma$0WvQ%5>jB z^QR~XjT!95Imop{`QcIETh9-V0^bsb&*%6hvDf>(t0mvtI6lD9k7Fs0(i_XSvZb-(vd6RktIVE1A}81(LXT{qE7j3O zrX+fk5$s@nk4WUcwK^OYvswL9>SZ_V1#(gSBFl1zb+W6gL%6YK+IgBOPm`Ueh4Z{1 z@|V*m>GH&q0yrd;wp@_xS>jiih~Z@ntpg?I2&)SFFSo zU)D+_k}qp1&Lm%@qVwg*e7afIS(GbBeg{dDq@P2HZbb_Dt9H>DRsV|4j=$TKvLQ?Lq);Aw@*Ge-c5s}*u&0a9^Q4d0%) zx<`&&A+EMyLXqAfKxV0TA{Ux60;S^$P52c07Ov2UkHr<5@xHinTs^jdNkum%ihhpFt3b0JXgMk%%M-cp zvy8Fi8f#D^sjbPtUBgi1kbAasSbRi&<=~@`%3Rh-T}qD6AtrmLqi%K{%VbZ=mQXaQ z)DpeC(^51C=Rvi?Wbbq|OfqDd2Z0+g8$yHzY)6>zKY*j$VmQVK8)P=&uS8rAHt@tY zZzpeUlNEwd0Sn=Lz9O6MOk9!1y75fXRwpIuABFk_KRksR9}xo=H9o{wR3q~fF~KcI zE~c@AaXkrVLW>Bn{PqJ58X|y?j1BU14jLp2end$vwtfEs4Tl6Vnhn2nx_>4LK~7={ zg=9CA1$JS=u5USt4fYa%`a-Nssu?8GVv$ITLv11@VP%T_I)+%8R}dh9cDA$*lBJax z&gS=j;WTqGaBQ{Fu`=7)%4|PM3*RCAk_ieNmCO(l3sE}nR?lN=a{}s36anksc6xl5 zUS)A1H+%!vg0SwR)MV519wd0JhH5y(A-oPb~(2VOKTp2liwG~N%Ih#OiIlV zp94R622T*&$@p(0{8K2XVCv?%KX>r|Cc$dEpOJsNr+axkteX95y-2H7A>WrEo-yDJZN~&z0V$34HqG)i;Pff4Vc_8 z0$W@leg<)Ba95g+YG%tjn4s8 z!v!H6h7F-Fq9BArbQR3$zLbEcw`#LT+EyOrLNmnj0kMBwPIrbd#p3EAvy=gA9;_j= z_H16r50BEMk;iIM&-bZG2{VKBbKY;+gLp%HGbkZ1u<6?tXsOUvH|CJM_)3%Ap%EW& zE84`WPm$bEkCe48_#@Gm2wK9Yr{u^7z~SCZ;%bgGIt70R%1A$8O#_0XpZK1S_H-Wu z&hyDmsM%WVJ})|BxyQU1Dxui)XbM0N&zh~wu9Y&Wgi7YlGA9E(IW1ZSPC89URL6xPWw1+IkjtEixy%>u$Rkgo5C~7e7&P^-S#a&B-R0QJlaAU@WaQWad-YaV&O!&8r>N# zoTMz(ws@uHr51nl?IPAD&uaxS{mNQJuu)7dhA>KGL>cNMpbFr$1L#8mShYep_ z^%&*iSZtltOc4%ehp&CvTHKpWt9CgAtr#(A(5;}olqaq3J;z$z8yK8Vs3|n*Fi>2A z_mU#mNRcT{O(N|GIUJ(nF6ZgWZJLE8g!@pJA7|9w4~YxY?BC$1y<2|dH2Z59WJ%4= z+&;GJE2zS1`RUvuM{PskURR}fO8O(MY|a&Jmm2~|ACz0@WZZnAw+)Wp>-vmnj{9A1 zIBJaHt{*zkcA`Z|&=LSA+DWrdxRbcc?Y20*11duhdvaVJ5w2n)Jv?g?qyQ$Oly_*1 z`#`R>M4QauY86~Lqx{#1d;pJIY<51BLazw!6RMZ_YU%^}HWa!HA%0J$Jh0imh!-XQ zrjI_q=`%jVXCLg3LiE!|7mgN6YL#bwnDI9l4jj41A*8fRIg9`-bvcZ!)MIyIU0G5P zXwDCu4!WO4k&|yzyB2qCnh>2IuZRX+6_qA!rhxv#kh?nlbd!q z`Zd;wtfrM4PK@e0YX$#J)(ZZWSi!%%Xet)6`<05KOO=IKoL+{->GQA{y}0N?h~=vw zmh+VvMS03}ELfjXG)ee1OR$jrA}nN|jD_qMV{bk${w5D!*4W@l+7kzF?e8u4jzhwQj+=5d}2hhb|=Ov$?qfeP7m!A z!?9~69?_nL7PHAoLDiA(TkTS=XEXstwGWEX(D1ggpAZE#X4gR^H9w6%FncVme2kS| zj+fr|H7bDjfnp5@i;(D3mqIjIG1!Q!w#LhM2Isa%4253T4|>S))vO$e?R_Q+cMz+4 z;}Y%s2<;^Qx4IJ2Haznqbt&8f&#Q|NX8w{|Ml6BX#?ZJ-jxoR3;-Xf}|5>=@iCmuV z?;d5x{LAxV>8%h22_@&7TPzeS)>6D&<#cs7al?|m4%d1=Hi(J*^G7i+z6lzazi3I92}O;VQ|Y#F5S-Uf~L)&#ssvG^x~Cqfc% zB{cFoHan!a5aNd=36@1H7uQW5+COkE?H_nmVpqeCBBpZuP35L5`KuTY}_Vxb+M%fkB3UJr*8r2oawwE1@<;#dt8aeZw71T zCp;d&EH6PqQ;BQ1P(2xsC{!<#vRs`O?w`H^TRmbcmT-RwT?IFd3-=?W?|tf$eq{V3 zE{-pzk4hMg5-8ShpVoC{cMeLT6psEw3P=CpJiVpEoz@B#wIG5e-Y?NWg$CCa{&PpT zAA22=uT$zSqJ-XXKfVV264X|yJHM%|fC6!NtMVgw`z-iSJeWi8nu`)BcMHDhEI07H z{;~4YzlL2u(+_kQO{vR9_u54oP$^% z!dU9V1tEtl+GGpJSuY7(;Oiz&Ae;EqNn)X-HKc(bmTw8+GRuMF%R@~4FHWAYssH*W ztI@P0G;OaMS99#9s!MHksD?^v{ctN`CK5#($HfR{2ebRn*%O~x;M{I&yGQSkx$Dexmvjo4mnuGmIzE^nh}K5UhdpeL<|_gA$P5^H}vVP*%s zOR8q_c53qdKSo*6@5AYiIT35`(}~3xiFNR*)0VLaS4Y*>rgs5*n|?~-$OJ@IjKsTi zf7qX{PFynh3q(&oK>gwa$t<9arjEYbsn+;73K}r@gl`NP_y*g(NF8up78yoE?X+mbD*9}=;G@8ptGu@pOS zqVutDpBtrMgTZ|LIIVdXN6>+vOafW(eolC$A}9HDs=duu!Fp*@W) zO*ieOhv*svLhhUGwu7Mx*y1BoL-y?_Qcb!QQ=-{+${C^r&YFTR}L) zd89mfml!Dq0!-;MBgM>TjAHVz7PN?u@M@XfA=~85Orw298^fr<`9!Y`FSg>VXEPD- zB4h(9gYn`HWF%kndvuqn_4%yH-T8T_bp8ZUKH5WH=lm}6(hqy_g-{EPgkGzv`S#a< z&q-9UgNkH)P<0faXGo|(xdmS_Q~pis8>v(q{JGZXi)|>?-?#_=(fjG2wySJx!3D7N zDGw`liM>TCZsuCoTGx`8G#Zb!OssL6bviEgB(`R~6Qb5)GWbR$oUi45#-3Os^*Oym zmav#q`qdZa0MV}1^Hk!1|h{S;$+lR+tr5k;%dX*BC!qkMPeY(M^zTW~LkB zUB)+Zqhbn_;)0a*)b_s6C*@BnA|rO%M%uLQL`^E0axnHgy`v#-6S{^kl1j!M$o-;AcNvwtBJk!XZu*^4^wMOdi5o{&$0DEfGHGo%DU1m*6`HM=&KL z#(S2{N7NCJ_ZX&WT3@8A^`Um!^!Tp1}YMnG1c~CCF`YXX5b8 zppE^=K)MuhdNC~LlIkl)3bWG!l?$h0zIHBSl57pC$iwd#I`p979&&i;0zW(_+qjUCSrRh(VtpRUP3=|bR$a> zjRkrcOtJm1wMm2u)gxU@fRQfnA2e1Oqeed|9~7}fdY0TkU!d3KWT@prfDA$yX&r-5 zW&Z4&4nw$hP_c7FVaiibSma1GPyo4%me0rDqdj6%8P@nI2(%9_-hUU01VKnUDkV|E ze7h25y3Nv*3$-~TP%1KVktmul>BwI9Iz+O-8m5Wehc}~Zw%~i!ZbLon|4f;v?H!13 z8Zg61$M zxL6;Gk?|*KF1MgEL@7#UG2C)u@BE`MF4mEt6G2Cs0rej5K+7jahZ6~2oG5-q>Z1Rn zf_-5E?Dhs5>`_AQcQry&JQkp2S5mi4Ft+B=Fg#>7-7Q8%r@=d=@%I1%hoHql|JF;f zmr<`?>Vcadxl5;r=IQs$&`Z4lmSFClB@n{g=L{s6g(xwWP6Lk#gkC&~VkpK!L5m=I zU`=OTTN_T9M`u{7At`ajZGtKiJPrI-Otv99wc#I#3_<DoF=5QCh zjiqIekRoSnBQquXEdBepk(m;GfQ^;&Dx=#D;1;{aD-j#Vqhp!WJ4~D4*<;YUQemBx zTGq(}RH&BWjcKQ-{>myov&N)DUTRjjPc(HSo^w> zuJs`(avv&2qZ+7Ktxs0xiyE*Qz_U~V5LQJjBDHi=x62ff3yE^oB~~LeM!;c+5^fCC zxo;9KjMALiUPw1|ol87RgZV|uo~Je&Mk#${hP_3f@G#4Rx(m(u*< zAbej;0}F(}tytkB&z>CU6|k5#I*epy+rVFF=^v5m%X^jRLs+h`0&AK;M;t7%&c zZqZ%8`Kr}ja-^Kf$cRaR5uM^D#sEQCWu`%85y}l@DOB2RBsVD&a8OJtZLzJ=R*^?c zV||&dC1md#trQ;*7_$>#?1kHkzyOn#INU_zW(6WS20123tP8J8WXV#x4|5XHbGswJ`PZW$s;Y0w4?A0z%XV zIT|BDw_}~NbK?f zM}j)T97)`>dSfZkDI;i@`n%Xp7Y-21u>uDO*uYrjCW{x0IzC?TI;)MOza5PifS3d? za6<*+4q|USyKNQ>=e7}w9lZt?3NbN=hZ%c>+e3KNYOu}IAeJ$>y|4uO+3aS1N<+EZBPbRm3>$tVFn z;9nCn+DS6zFHM#x5Z@rM=}?Yfa}8KTaGQK2s+dm>wwj?mmGH^h4mQUptJ`HO%WQuM zP{qEIJIEosmMHCJ^0KWys=&!h2%NQd+o+Ng0!IYGumc4I5tCSAlXsT&GU1)I94E)-=j#p4V=c8?#TInkyBr%G2ero zgM% z!aGo6dn_66jF`_ygq$dReM;f~Mt6Zuh@5HRLijztPxx2O3J{pNb{%8S*(bXb&)DiA zHwkw5!#}(w*%F-Z#EFPEP-Hsy5X{*a(-jRYTTS3TGIxHNh6^-6${E;C1}&(Gzx5>i zKka%D25t{>2dC)uGxVSr$^li@RYlP93?n`%=YNU-QUZ4TRU76Ok7r9?v=tNCotRs6 z3Q>16CH z(xUd~e~fMHv0P(EldFX9U(w4CM%`b+XJ?ABzW2*e%-Y~k!Sz*!|2iHQmQ%!R}&f1>b)ZPix_Ze@1 zDr9}hlLHWm1)L`Mwzk#l68$qj&sj;;0W`v|hY<-N)eKCk7InMvU%IOe%{2Ck`2XX? ztvV9rQfGCKYWRnW4cR*A=Gd&~o3}c&(1sqMj?bkIX{Rf40Xj4S%7|rvk4RXy#caq+ zBQ}UY;)8lH+X!?}l>2;yDop5Fi7m*qzAUvyw0CP>3Ka_Cgq9$gXC`Vt79|Rjb?A|m z)fn2Q^?8q3$9SsaKWm*99=i@wo>S|%5p`h0^oBQ;3au|wJ;QE}XaPx`uI~;|Q#~rJ zUSm(vFik}`wPa2M7(zks3gaE16&l(?^ivtV$zj;@bFe^UKl&ZGw|otO{S9xDyJ3&$ z8wsD$+2w_0(AMXJ0d0g!^CmG`%?E zd)fGh4wK|xELnl}(o~u1#geoX!Xd*v1ko!5)(y8fI3*c!43fd{vZ$t>SP3v8fm&k0 z9J<2nBvB~Z1{p?VmEzZW>UseU&mSbkqd4AXTXll^{?mJ@Eu=nAvDGF_AIxzn(;2%% z9JBL?iC9~>3)g1Asx8TbN3fZj)&Ne9IY`nllAU}r8#S>MQ?J1mM1!BXy}Ik=%Thqt2>?f8g4vc0*&8~IjoItYJ9u^O|LR9 zJ>;}~58l&W_RuE`_8ZlE3>A403I@baw8C4P8g@|Y*WtHOwefurmNPw%_cky znGrh+bPi-u->Ede!bw<+;VyWMIg|ObkN_-cK)`;g0=IjJ@><+(3}&rr#4416mg<)= z-N?Sg5crt+)V~RCMc?Zbk#HO%LE>$)Z58NXPb}RAdq|jN#e&)BW$>$HwzaCpc8UR> zqsH3>a_PgcBHk`A8CZ2b4@;;OCD8kbqTNo$fYyJyye)v*;(5{O%@W28;*&l-LdzUr zBvqKXbIFtV*W_jadde8#@#jOK?HZ@lDy1(WF`?+YI-@YeWShJ(&8Ois*I7U1x`A)-eE{=p0qR{29jwIF8`RLf@Q)gUAy7$6w*)#lqN=%F#cK-$!T6^na$F z5AtYkA5GE4KIyqWT-4xu3JAf( z)f6$li%62-FP2oVwiU64+1l0|Ngac1C0=5a^t>{Dr!RgddIcW&c2DSdA z-)8vdoWkq)M$cS+J(d^gdLM$}B1Pe_kVWH_}EHs^sg{Bu_#n*W$ zUrd&tp{|`Rff;Fse>?4=murDUkcm&IV-_x_HYGuQ|?yLCY%X5;}tloonw$PyG zQc_-L`6UP5px4h=$04YEjKv%5+*w#Sn+w5LziA#;^?Abeu17b{n$@z&UG&!tmlgdL zE7g#)VRF%jXwOILB~6Q5;r{0-HSHw@E4f}$M>j3P+O8Lg2fd_Z6>Z%#TDxbVMBp5t zwqX(6CDgqadWoGYMY(Dj(96hyzX>~s z$n#z?mi6G|dR^ag7(0+#UgfU;6aXYXKS}^h1^_u0 z06qrbbO1mt+Nt0x0zKBt-AV$2PE?Q0&LS;$%}A&Mf(xFXPz3}h9f!qZZ;HiZ)#Yw;aX?pgR(f_hN@AE07D{&YXqaEv^9eE(7+aIoQh^0{l1!cn=m@ zx(njnBLv%b)R*ZAn1%W>F#)qsU&aXa#p3;K=^y+5CP%&k&fhc!gC>*vAu(=_kNt;> zE`#`(D8$D}7XkTkNbv5HE&>ANTc=nABuMBKi`cEsJ9$)YzKmqZ?}Q9FX++R=*@A_i zWDx)(d}_@gF+%g8Dp${(kpO^p!`fDfK6zX$;Zx{C>rjR?BVi4IYu#np@YiC z55ch_p;O#TNz0ZT6`bt%WnOadyb_9jB{Bc-+o*diG;;p|^$ghet6~zFda+{neK4rt zB!stxH1R6q`7qM`&u_=SQkoADe%QFyZG4RFDX{8>>`7~WL+$gchc}K7Ev}58wnKt- zM(!{rpX!cz#QW-R05OXA`hFBvqibYaF(s@Ji{UbLZ4Z(RIeA+v-5|3Ji@s{2?lHo} zOQr0^2BU)u;5MVZGFT!y%j=OPe#bGlLw2%BJ23C77s;!FFulKvusg+gH;5uwkb5n)6av5O} zoJlqT6yZU^TWJk`X>X)+PIjee&26AI`Zr({x_(baFgS*D?#uCou7b z*HBhbeABv+Sqv|maDeu$4u~RQO$bw#V^KP#cK8 z;n-pykh0teZjRP(_G8idqB?a#Wi+T@S=LPKf5GfZ&9XkcOI{|~XuJ>j(p^|-W86=d z4g2nb4~eem*FDMz&ci+=oIvwFnm_6HP)tOzbzcjIDV(Ua zb>4Iz{7rdOAgu?#5Va-Bm}r%;%q~M6E&6DM)j0@>iD6fHyq)Rh5~U>}^A=3cW2yLx zl*lka5lQ$|&Y`%vwNmY71|iJ`K^3GJG9{;#9|~Z*4-#;TmV=H~f{v&IsDaI);W~hW zb*OxzD~aZ0dCk+SmoK2C3^^gZE)`u-}XY6~yc zh5(=6{W2yjl1YFmz~fNBF$e$w$|19J5;cQ5J!*Ain6dc6d6bThgdqWDnbMi3Tlm_} zV~(er=2ITR6i5NWqD3Dt?N<9}y757Q6R?Q&BFf+$`1>#g+^6gWjIB9i*S zu0oXW)n;R!?I-9nngXmc|B-9Awh(h*l6rxFxYmOKbstOX!xq0FKMNY45rPU|!HBqnrrA?`I~K81hrHdu;yQ+?B672x>^ z9cUq-vRORQdrxj+ev?KzGepGXrppbt0S==SQ(4D5t%*inq7}NpwCmh1Wugclpotxb zW?s9+OMRCVp;*YID&roH{~oV$1)R$9D?{eFpI9SBj!*yv#)e40qL0$Sh2=;a(n;mI z$E&^)-O|baXnJ*gBFm3O7Hy8Cb`WzkN->qwp=6N5SAj2~16Y-`d(clFqtxRsMg7`~ zPg9~YHL2r5rkqRN!^B#NGDGGVURMgL#%BFg3Cd8g3p`P0t(WNAD%|`p&d6_`fs9s` zY#su;63;$GoguUNT&jjk{QwC9Cvrr?^$zRJ9DZ|a;>}jdc!u!`_IpO#>{*ZUj>^R$ zv+he&9*>`IQ?@F%ozKx1^UFKdx+w3!RLV=5_lA&psSOCi5e16F-5J`J4oNKxnd6*? zWfoAm4AcjlPSib}5sZ+4_s_8!q?}U|3$9KF5JEOs%Q2VE65XG)ys5-W!fHcxYRFUz z9hA_*1r$OduqlPe)*Cd3+9K$z;5ATM9-vya!t9+X>aYi{bq2i)UW)I(!R>V$nu3YB z+V$L&iB3}>Wj04w*^-pG>5>ZbqY9gm58|ey9ATPn2~!BqhJAHu>8)`NGq41ukfIwc zDH`WBc!V?xtRzXQT!>wT&a0}bs;y;!?q@_2ZXd$>xCu5^w{r(bwF+mt)y{+ueS%$* zTn1YOgLXtRSR~3lGg0mpiC1RQD*yq^zVUH@;18D7BS<*UuFP85Mmequnde|HY{Ay2 z56ik=W2KWx?+=)+5%Qd(d%71`L?h(+e{%6WKAI_CvP`$dz`cpG?iXc2ltXf-i1P1( zK{1=Q!~pR#OCK5}zvtRjs`;!+4sJB)_R_O$48J3w?S7dc8zRu(Uu4rkvPP9E&>=pA zKtDo^LhMTe8axX9-NZfl2-i>DJv{y0;naHy^yg8JpZ>-;0D=C-o@HalroVLzbr+{| zUmh?0J(GClDD?N(nO0?j{)Q!x)vSgyvHjH|5FXB?Cs4E;>r?m81)*OM2=GthEo9Oc zVT3X+7C(o~kKI;^@}b5H=Os0tiR1zV{b+T*G-X1_e1Yfc!K)Dl5?qboa*HX^K2591 zB(s&^1iyh}1NJA?sy9A}90(WE8z1J29I?{SK#W4;qm<$jQ?7Sj3!7>G?Y(;+hT40srF*tsV~-NcZn9MJp_Yfk zEJK0~n%{8hc~#3CFfxy!ZKh~{A|8N&|2q#m>L?rdu@1b)=wC0QD+F0k|5Es%-J!Up zFmd}fxqrRTc;tp>@sxU5t1m);x>1a9@gh`@-OY*s3#_Dh5N?}CAke=aY4gxTL_w87 zN+9NEUV4kaZ7Y(?Dv+$zmq}ab2K~2HtFNGGlVAnCfU;e}M#CfQ-}e~O=oe$&Ev|ls z6IGbl-A@4>y$s?M4NC{5pfQxiZVc2z$34^wcY>`QGCuKe3HIJ6pTY9={#TVdL8WFo zV*E_ElC7C(3N6;b=!ykAz%YN8m?F~nyTl%QIj}h)0(ND@Yuno~C}$$K>r6ldH+q;*z>%h5>LnU%`gS5sMi&LiS@CuVh!(fvy#CIN57fdAi3;;Q`<_F@e%xzCh7I7tdgDvNSaaT(8f=MLDsw?whP|oePql%gb$+ zZo`rDfr{7x~{%{6k6^+MwB@lq;PEP2~n%BmiXL`vm5q1j_^a{1J0& z)}r%)Wx?;LT@EVw!sgcw89}s{U2KsNb4qmXUg;yy2VXpIU%bR6;?9<2qFj_G=0{xR z;ww7^Z&xi@0*m-(04`+oo1<*F)RDqm2S`|$;Xfir9)L>Gg!qmur6$~;OMCa$Z(2q> zD|_$(mq#})n6+;c(*C-k1b;vx(l%TX?*CBvQn>#kxnUt#8c4b5c{MA%HSHxi;zvT! zOX~Qh`DsNj;>(A8D@XEh*6I;DGBVu1Ro-?QZt=eALwU}t5+`Ct{}U)407#B}$QSe( z#H}<({wKbr2ouy8R&!7zrkwZvU-G^MKC0^4dy-7T025|_j7AM5O3)yv(IgreqTv;= zA|^Z%kf(}tjHn1Rhzb~-L>UfIv}$duUQ@Kid+n9mS_{@kLXZTdfcQe8Ek0V$Fkq=t z2#U`4|L=WXGjkGcd%xdzzu)CYX7-%3*4k_T&)RFR{WyE$DxNR%f5y}BJ3(`nr{Py3 zG0W5Nj7a2r8ehTllJ9)6Ds#DeE53~mv**5F;irFv8!SjPjgI>}ajGSfHR?XM_HaB6 zFQJnHb@D?)@n}ph5D^Wl@B%+!H-^t|79NzWcG4+`hnLZ*?2UR5187b`JCdifX?i@` ziP%*01=^83xcp7@LtIW?xs=h_G~?@NJMJW?k#4HdA8LqvPXonx(N+qVBsGezm3h%G zp`Th{-j~h^eo1%^je3r$S#dITva1TWOQ)l;4w9_@yw4JrMFig{$@k9}5;DGq{iE&3 z_Pp@ESdN__(1(v=z)C4l{p~A#@X+OKOPu6OS2{U+Y{@D-_%h4?!oy6 zu{gp1=F+~N7o5XKg%4cT`f*mqUjOUM|BBLQd}-SEGX)0PFCyN+U8{Wq%~f9&=EFVT zn~Um(nv1%&>Z>PFc|7;_Z>8N zk%qs(E%1!PjyhBJBq?5wQ7|L5P_O}j(Kk`JTby5ag%=4y<*Dy1oOzRAP*=th~ z#B9CA-lLKBsMDeHF1;uEMcn0V$Zo8!h?aZl?( ziN;&4Li?;uUyQ=N?gBRk8tdx+f>;)R9r!zhKkuiAd+|3Nf6MXrB>uMIPsN{Gb$E;L z*ML7qw)mHpp5e^Q>LGtmzz&+<(A-%$TF9D>fhP(;3UfXcsQEp!+7#@ z12sbmwknl)k2Q@84e;=?W2bRf#Xgu~!}2U~1&>oCdWq-y6imb%(uq8=5x*l(aA3!e zGwK`efW>P4i8VcVh&8wOO~N$bw<1}a0t#1UWUb{er;)tSu*ro-Vrk;!byFs1q+_lFGD|2X}y{z%_hzReqZ930JqWdCI9IHuOS(T#-e=pJE7of# z-LJrXghA%jVw}`)L_cs*WHG>!g)*lb*)Qkig?^ zyaeCHdzzLw*SJUUY?DhEi{n6(EukLu%SWJRbvDj13C(4?UR=Ve>i)bmQC=E{FD$RV z6rn>;8DZ{@J+I;1Q{bGjJGNd61$qi#ap6Hdp!AI0hM(az&Jm(#=V|x_41j0R{u{qx zmOtV*%<_JIZwd7lN_iUU`4e`Tpx4c~(#LY;nIKkpI~)!#T1UPx|{eS_rFl5 z66E$U<@z93^l3s@n#$$W-u|9ae1em# z19Diw@eR`npR4B(d;-_EIr5E`Q<5)#Q)?JmQc(-cf+zNs*^HpPQ_L3*jrnv`fT6E* z;;|`jc<>UvsOOuCAS7tkr?f&n^i?>C`f#Y|6)0hH!SHU>xq`2YPRjr2@uAUZIJAc^ zX1VypF_O6=7elE6T67#*=0?Qv#~Rf7aE&=X$Hlx|wa?FURDv&ajKg`IXfo^?XYM1Z zn2qxtVwf zJq~xIwUD_o>NNXR)u$S*=SjWw{2yx_2@TpsfWS0z6!RW2gCQLIg`y~E$gGY6_24?4 zB>2DA0e5;De}?f2s{@8Vszz-o-Y!%{@HV>uf5tEAZ7x7BQS&w*a$L-4MuFzX zVsWxS^EKT2pWPM}Z#TndZ0`=39tIFt(K>5nFYG90Emv=|T!;TVW6ED+!J3BU!(GIb z>vWR;JuVHS9U_=CLoAM(H$IB6GW^OzFhq2FMVKg3?Dp~>-U<@aI(UW-tMilbm^`0Q zy1uj(UNL*IfpLP?aaAXXiA7HDTc$8DTlAj)O-}=lEtD>f!(P(GF%Ax|IEjtneu9+6 z$#GJgeld*ircoH>4=xuzZ)uJCg_zw${RsY4)D4gDdGKoEPDa_a);wN+*?pBS;%9V5 zPnEaWbL}sCuEwpC@Dc2^$_oi@4~&1r-2_7(EhcJ21wBP~cV~cNye7ahupMod?uR4z zI64k{qKSP0lAWI6Afw`)Pq{Gw8MrNEG1}qh zuM}4|7*|bKN9QPA-B_^;i$F_-JFCC!oTOQqFT}>7f}mac!flRoj6x+K-(iwI_CMb> zT1FNCEDYHZeNez+;~YP88%}J?f2VVN#FSgtg>zh@ll<>-j;2!-K2o{T>pv0XT9@cd z_(y5CYq9=9YgUSIQ5)|S?oOR2mTZVAAR#9m%ue7$leC7U)7)HK=foC} zr*C&&QvczJbWSu#&z{7MA&EXFcdpJIKHwSI3p}T9um8vc0rjnyaGt_&eVqNSL<8er z;f-=j9*~;qyo`ww%{<#taM2Q;3JUAADjE0EPfEmCsxDg|(mpF`*+gDwq3yoaA>$Is z_|G>y6mmXohn%l(7ECek|x=F*U<_^pA`M&DFX7e;Etv1~9oCTVH=D z)>)s4by!N}{GpZeFfp%YfdP!|1G-S!et9B;S%ThE9c{^Dy2>C%RSCLymIQ2BjJ?+M+n7o zq4tPkg|eh4Rwj+bA;7i%jwNR)E35qNOU@YDSzCoS%}3%*bFLf47M+z7Guk7SRk7aw z%BoOSWYWaQq$>3Fhp(LK33ESQZ9WLC1m>7T{^+#fT{OKqav2S7pf@zz1?_O;8ZcV0 zPMI?wuftE8SG-4A85sJ0IG(1hVY%uXEHU)l`v(*|98dQ=+)})q-w(Bhze@Mqy$Z}q z&Ag_Oy|9xNd>Fb|o)>zy9&lx}DjlmnbRe!+b;7ZqGq&%76lpAr3|%go1pfz~yK~7; zp1aapKgFVg%hNMXD7z9E8}9_o;5gJ?^(jBYEfuW?dS$dn`#>eJq9Mv-qSo}J6P8<% zT&z1`x!~a(-3iMbSaOs1vTDQuif2Kx|1HnGFGCarL6z3>eJkULKF*o#T54 zBFVkuFNezyVug8j@Un0x7Gs4wS1v6rZ-nsR`Q=aIYjKbA_xnNf6%+SuhJ2(tWs*KTBGjz4=<~a*008NW|h(*E@fFR6Eej>Y{*TVbJlIOL(v8X!m(^x?O@*iN5!_Thh-H(@ z(^v%kv9ALvhWvd!ezS_){fP))7ee*;U7owI#$`jU!^;h6U7Bcfkz3_Lo`Sy8ouoz! z)X=LfRdicaT#kE@NiOYnN(tsAmjH##XqSpW1J4U>nmoKOY37n5CO<{Yq+~_*Cn%C~ zdu+n(lnf4__nd$<^c4EFCY5(92=&5NZG$0+$7$`N(?2r0)Vdl<&2&@`tjmOxn(wci z6J!R5#rFAIYR;ZlcH11>--UEtEnx{;f4=SZ{ zSap19QGBSe9Dcf@(em{*(Iy zGA$0E8t2m21J5Z~(;JQlOSf8u2ch@5bIqIeA04Rw5}LkB<2N@WE*XkT>*IR~7 zX;wSYE|#Uo{CM*jFOR07zMUimTtMOK9FMXaWUU8#kzOWU^#==9PxYkZ`s%U0)4}Wn zy8g;SPvbX?A14h{D$B(4bm4ir1)y_hVju;BwHlmw)R9W;h9FNx6u816BpNG;vZ~Htt1yJE>DtLEG#mVVmH4Xbv;-fD=@J>)gtVsO|?PDxceFtBj z7g}Niv3W;4WmnJ5?%24ra{W;&#+|1M>!Cc-8d?o$DOx5QHc*u;B_; zAx95@O+5p$R*(Dm*J-O~e;U62q$6BjFf+r8`LDVj>Jd27_Due!^{G`L#T@tb>KAbP zf!j_=^Qt__LcN=0&Vpk(xWMBhR7Q)qusl7(8^AlIUNzVoxz2zk4^a=Gm=Ka52=eYC z-mMaMWkxigi}pbmR6u|oSI6Q)148(T{4oQ9l_TLx9l`J6Fl||sV1KNZuS*9G%Eih~ z^_S2s{%$|DMW|B3w+=bm$V^>XB&tEFH zid>D82MjRM1sET*WNewkg9Spmf|zIruzU<-DSk%r_J$VE!>vlIx|CU~{|*-JsNPf0 z{7Gh>gM0A$c+J%_yqwwI#V7JMWQly^X~A9yUxJy4&0`nhV@fS^coFxNBazT2JgV;r z{E(M9z-?T<*SOq)9K~fsNujgwg2(r!R8h)CT%Urs=3MGpFv`?CaN%u@%y2v-G(k#b z>!wK!mdZ;bK&2ds6)0C8Qqrp9MS=fxr@;d8-%W8hux;O(+ooKv79WF_8br!A^+r6n zHduF!Qksui09}Md_v7v}J2mbv0C4=>IW$^OhF7?;E2zpD9W#ShU=n;qNRj|`pA!)$ zvW{bt21c`jTu4^MeQtcsW~QqSF_^47RoxEIQBO1L(r5gB$a>cdG=AAme)=5z z9B>lPAyV4O&+?=AT(H)cj~fftX6J~n0Y}8e%tPX9uqwXJ`vhN)-Jh8Y5@noYy<2=c z*L(5ZG|sg?kG~uDqdjlWoDNdF`sHZm&Gk9>)t>3XC-rX6bc?&Ja=BWn&N=}@k)WJZVQx1(~Js&g}T zBawCEk;076{qF`(!+W0o@4FZG!U=^Lquu_F#qRKyLTvndP;^9;EwK~oy?An{xEU9< zw9Rj(qp5kN5Dr19a>ktg-9gkb<@F<;|LOypBNw&IY1^1Kr%jzKn1Vgj|A48*a@9-m zyGp$SpKt;}%2Jo$$Hp|gy`%1e(1w;7@LX-`DqMwk5)>hs?x8M3B6b+W>a|Fzv+;o+ zD4lu`CWDM~g|P@@x-v(Y_%CQS({kdWym%;A{R(6=X3TC=UljB~cVHNbpr%96j5d|W z-0_u`IBrs(uSp#}j!$8RE=Q=xw#>0~f+|;LtAD^9=;*u%yAG+l<&R$AdyRat=*BdG zJSO!SN8t6V%yfAwlNJ?ji>GnU5eM( zHuE0i9km(0fesy~FE1-_EI(7L=^N8x196Ol;wav}stjUV(En0e=?^r5i(1rq$XqRQwLBTrhytju+^*1$!Rfy`J?gwt!~>$9?&5GdKyRm^&t)jQjHN^Fk(aWuj@^ zArR$|=*lAq35%~hRE!-UI{drva@|#s9rHHs#0$)=*?q@59IXeuy*uEPApiKA5mB$@ zBNV0xkJv9Guk#);dHJjjiW**w zb%tHe$ONZ~t(o*n@GVu=S?}rp0YZ87eumi?aQxz$l z2bpR;jR_t8Mm8pqrq%p>xPhOK*Yoo?%lY~8GJGyr`|wlZtLahk^>|QxH7*igPcIZ- zzYO5(vHKf2HKB}iMj9VNqKSzok!Tkh(1$7&C+n&rjqAkS4LHM;@6vz)y0nkmfcBuG zecZE*TO#A0kNbuJmKwZxa(rLYxD8m1BTI7nK0LE;+GI1rQ=Mfy0+)jLwvD@mpP9)* z%09!CnpdWx`uvU`{x6o~)+(2x$?U1@Qp=D{{Jrotr~iw^2l48D8%Sr7lpl$tn0rYi zjSpUkAV?pf3G_ZS%{xC{3Mz*(w!j-%Sm15K-_QeC#wAP=##Q`URpfdVM@3`nJ*{G~ zNaK#oUr)ZzG0uHtKCB1-X3T{;Xbh@9mo^WVsI}IC$I*5NXld$pz=U>N)_}qDQD8^- zP~nu~ePenK@PeSOmwF#a=p=6<>GemjlUq2Ox6+HZ*VIM^kf&+I-YK4+DPPQt^oZQ% zj9lf4)M8;2&Y}1O%B}j_4L4tZInHhSO@dU7xBwiUWFwI!9KW%uO7IV!FSlp1JEP9D=i`tIImb< zSkZ}1AEAYc{PDnXocHpJ>UvDaA{3!-6V5fsh%9kNu5d-BK;`|}h#HGhqvNxFkC&kK@?5Bl+ujHP|oQkuR^qVL8M#?fiIDa=we5nFBJmlx;iWgT1in z_}~ihIaYj@h|dY)Gax<}iqA#jGblcniO+fBbGi7e7oQE{b3Q)NxE8l0y~n59XYw}& z{hm!jdA2$w1GeSNZhid%*KOx}Ubtua=?FXv8Ykcj5ltWRwI1;F zZk^MX@bmcIIc-pJ7-|?)6zK{mhd#tsCxcKlrgPeAYYYmU5t4;)6sNt^D3|BP-vpV` zK6g&rx(sCW`Dtn1kMYMeI+7U~Jgqwk5SFj_*zt;~cz$WYtazFNm6VDiIMJa>MFqYJ zs^h!0{DZm3$e&F#g2R-ZFFHrV)kKGY70m}!h9B}Z2cU0YBkshD;=ac~iXAePZF98e zQ=|M%sdQ@j#TU7Q1DgxM8E}CC?;V5XDZxTnXOK;zNc9fL3N!-qn#jZrLag6hB z6dMsBvw-~K?fz0eQMBd7E&kHIB8dY8{H1)fo`<&d-qO1@=wv|wWDvIn)DoC*`Mfc3 zCsU@?)Os4$pk&H`>Co?$MYyV**8*at{186ZRHpUH3J%Ba)mS|dUwSnD7KFqws&*2P zoq|_rmCDWu7{WM;7FOiojSVm^y%WPaLjCqEaoeR#Iuc1!Dvu~^zs{(FcixIwra0b} z-~jKH!{ zz}8uXUZ(E=GOG&I;{xvHi;HW<77W87TO-C6I74UQM=zwZLb-hFcdZatyhF{vtmvw( z%&850&ZyKIEvKgu>xvxQEw%!=z{E5> zs;8@}au){M3t%G3g96al_oPc8VY z(i9q2LyfjWBM&qh?hU#}QK6m7kFpL(Np1Rmc1lF(^Lp?_`0~$DAAFid8eZ^!eGD3J zGL3vPR+j;=bZ0S98RbI8I3n)0i{aXa4NOC5*S0_zYh^Wp^ z>}a?cQ|j2y)o^kc8@V6x9xA%hY2)EAmv#7iXL* zcMD(W`-k*>969puF8tk!znk%Q2mbEIpMKAx@0G+C`@0SRxNGwTxT%=7p?aLwydNkA zUaCm&xo{E$c%-Nv1h{Xi!uNFp@Pc(`Ak**RZxH@2)c&fgQLmhF-%&Uc*1F{1=tedl zn4jUL169h)u3QmlRI@B8xQ7E1GnWg;c_&%KV@CQt> zUEEv%PE@}06ki@vO2-uSbB4=2vJ5@*JVB3y+cXu(5DLD8FQ)7u)Bh=)5X1Nd~NDNzLb?po!`#>1Y5G{)QeLgfL5 zqH*79k%N;F_@{Ufk$^K&7Vj~4_Ih%*XXfLx0@vF!`6$8a0B|lGZB{Ct_8Zfbchz)8 z?l{v9rsLnX;@sg2+nh}~ZJ37W6&Vpui{o7xu%WtC>+s{yG9g9Drg;C~LKimOTG8bE zJIEYWfOKIR(8r-|E*RKU(N`%Yq0BQP%H%(?@?7P!rkpQ^s=7ZP-Pts`GcwwR#waq{ z9X^~EIs_ZeA%A5AIz>jd#d}1A-ns%-e>p{YzZUsjsFVwfjt9@tEPB@zH6M!6o&^Xi z`V61d?!=(5vwiN&xTB4GKEaY;KTV6{#c>Qu;F+rQSHAD{ zXLrs(=RlF8mm`D%Pe8^O_h2$>?-tKz&9dHb`fxg&xC+!4X8d_O0WP2Sj4 zC7Wu-OUYM_XRK6AfHQE$cgM2gzWtWx$me<#)kZ02#0M}@qH*Pn^THXdonxF+bn`%+ zEA)$7!BhN#JXl&QxdmVFoZ`c=K^TUGptuMXiw{c;;-x|x-z?z}08$B`zA~pwSviu& z$c}}Bt1QD;E_Wo`4$r_1a;&Baoch`+WaC4ynf+_CO)pYY%PKorIf0Q9mKz?;joN>9 zO}zA3K!pMf69vZ<+3lyM)?U$HNWH8D%c4FDR~;`cybjX;){e698RNjMeKo~#RK7g? z2(~+BAUuWYvK#e!p%3-AA^!gpcf7f zadD@*6&%n`EZ%DaPnDM03k~>T0nxMiXX?kU21(D66mmL=PvhY?f8%ER$Hi@MtQL|C2l`pH4Dz?^S_pM83H#b)l z)~$5LGQzv!jq%%2{|R#OKA6wte=^%aO9wci$)fjQB$CU=RWYH~KD*Gl&5y!o5IU8< zgMK7dp^TFh5_Jph0zOEHq9m_#` zTdZVL$@qm<#lI&p5{z{YD;t8e5imkB#@%hx*oPzi-DnNPsc3 zO_}5J&vkhkXV5!NLi~zpH0+dc0t3SsZtygY;`JJ@^13qK+Zs)8Rnx;C_P`P>e}|`$ zi~Xm)T!1HbY)gKy@3Acv%4;v?;wK84aU|wamKKPgVBL@(?6sl7Gwxth&IPdyrM6%; z_xQsaiY(6yBVv8IKcCC<+bqv-N5q^;mNLTM?rGcxN#U=sx4Eprp6A}ch8>IhDp~&Y z5QagV;Vn*FSn}8KiIc(dHCZFlL+6A~d>y<9V=*H}r(s9J6W;^}uc=HQF*+RwXrM&7 zYbrBFjLryp&)AOf-|cC08@JCvXM84x>F}DY{zDnSAtH2*zrel5Euqm!e#K;K=o0CL zUV?dREw88HdCpeuRDa0VUhVs)9HWuZ8~oj9t-tIIohFCIUeYRwHZ;ac0v|OQVQg}Y zgU${{Ffel>U0zFDO2tdMG3L zAqUZEakcp~r;>8IQsctliGo#kP384?AfZYT*vu+$(_JZ(oyS`9aokx89%`lgSZjI{ z!p2}f1S#oQv9kwWUX!Q)#?GF?gVbWlgYRutb2R?!0F8p&JmtN3Mr5wLI_^+*M#g*N zS?U#-^9F&Uey6_4Yf`vY`S1lO;UN)uth*LjRZOJ6&k{>sFl(X(a7N_!0SaPTSSv-3?u^c|ObohX$R_H$HLKg2)uMj0L z?8S>gienWnXRt@{p6Ec>i{cYqPcXk_ z7q9Rt6THn6@Wby~d0Jp3pNelIY9LW+3Br$wVNfgsc}K}686JRgMCrNe1Vv|gtErz~Kmt;qZFz#;EwVSSCz3W1D}x z%M)G)T4n6L%n4mmWo8K)$GgIJqJ+1Hm!qc;9Nl>A_Dhuv6uhif48ybK$vC2naU;kh zPSjBhPbI`we7gnqD2tsytL!XpIsRsA)X=E|I_-o`SGh8F`mb^=9*Gt{2Tz^;n6<`* zoiT*TB17L)l#u3-T3aLyT03N{I9H=Ivf`k2`)gf`{Wa*CTE+H|m9edRsjP!-%Ge*d z=jsA+%rKM^vk|p57=G(sqc$;~!ua%gJP!<VPTimwSmrZtCRCa z7o&44-QP>v9WAO7TF^w%*kHzyp^y@&K+nuO4Go8$H$6S-o_)jPr9_LJ=?xFGw=_M_ z|DSGpijs6rYI;Ns!%&@!K$P(%A^;m-hA)KeBk|=zU3amrd)vp0u8s5^<3<0bs(rjR zT$e8%8;*xB!3ur`+33t8u;k1x>ID|%NUzDUjSc2q&IN;xW`-jrd&Se4;*}Z&TzE!( z;#s(q!(X`UX2py2j}+lMKjKoZs!~o4?Sf2;2zNl)jNuBU$js zL?x1jrytQP+5e zjWHZfpJ)TRKBfT^2Xp&yAQ#maSVIXc#)@N80W|hm-Gc-c~YI3!lk@R9F(`KlcvamA&)Nw|63Y@_zAfAG03~fZh z#~~nPuhLJsqQw7ta4<@rXLR2X;HrE<0jt?B{}3Z;IQBw>p`dLaBkEp_vSeiY7*XZW zc$Kw}5w+0PsJ{CMOnjU}d5x`vu606r5qxVy0>~U3M~QWEu7^Niit+qNI_%b^ z)RZNT=|{Y{?AAv1=R{0K-QH>J%8ZgobxDnK>qwY;S!5K)x?%1k|HYb2b5|}0*7_0v zbapc^g=~WEX~bLVj_7-TipMp5rYUuBKo|{aJS?a7i-P0D^!M*EwU1rWaCt$~)o!If z#**giV@c)uSW*c@%OwS;>tjiM(cJ&&0LG36$>VQlx0z!~&mrIBF(uFVFs4|(UjF#p znFz75A^S|7PiPoEL_qV{?0kSB!Q5Jo!LnlM5na>BFp?sqgX7MLEH4;Fubsn>e7=*& zNRZ7uMzF8rSj>5OjCLEI3KohB^NUc=X{`^hiRV8*m}GkAj2E^GW0=_G4Fi zC@%l&o`&~vA$&U`_94nBZ}`Bxk@G?$;lN@e!owZGmm#`v=o@^h=r~23Yof1#yc!*> z9%!AuqQ@-GL_LJ8J&;QanDtHOlIsqABM@8 z9Tod_cn#?cJdNCIqVX8B2o4XoJ8`C*r;*39D8R-4CpmklWXLjns+VE5q0A&Ib2I#3 zA@G6vL*EbuxDRrIFHwdLt%ffeyh1C)jq5R*qX&@QHk2xs&vIwz77XzwHuSQygH(^fH<* z(xRUv4=I-j!HTryQ`JJ0MT+4cXsB$!qqRUQZ}Tt+@_(cJaZ?!*o-1b++_m9!j4AgEI%BV@FsF*WSL*8XBl-v(QDP0KA&3}D>lt;+xE7|eo?{-Ui`|I%ieefd1_z!l0(cmW zf;iNN^_;Kop7$hqCrI8~1#gSSd-7ZJ{hGXP@UnVTtrrsz2*^1FAy!jFve|UQ^LC^A zplczc18aO0L9CQIkbPhwAx(?F%kuLfcVC9Vl+gegaYvwooPv)NtKIXRL%xaRD`h6& z-b-$6CZ$v0z{$^U)E`0-Jt0DU1AVgu=9nr@8PIn-eko-E32UHXgos=s1i~-L`nQ!2Tys_iE6#8O{%Yis`$T$|- zv$_X=OcV%sR)1NH9~U4*!JWp#_))E7A3%XI!Z+m4V&F=Qu5^QHH8c1%IF$jzpb#dc z$*)C)SPjXC;*nKo3Q4o^08%Df;-vx9SLM7#kbsI&Gz}8oVKaeA?o_Za^r%(J*_3!O zGDo&0u;0XNPm^`nB%e$2M^OGQ6hPKhwcTdTI7Ala2Fm)~MI!47^Sa2|B)^g5XV_&e zD^v6CYvFQ7c`*g~wn*iK@|z!%POKM#_EM%}=g6m{{t|1rV!86ii{uROwz@!Wj%9CR z{S4JZ)WreS6<;Bq6(S$Xft!YPm`zLCfnBb_e}ST@nF|lp{3O(upgkp01nuNZ`V#b10UFZ=Xv^^Oy#X3I1H7$X zD7UDx2d%#W+P&1}jUs}!9F72>QJxhvlQu%y^KJF^1-QUsm+B`oU4aIg$-I`##KQud(v4AB0Ax?FQUK|3Tt zqdY5UChadtyOrfm1{D<@GK_j;dCYL+WXku-vEuA0p3<06vvav6_6>-&?yFJFH@IcD2w7#!3ImCJS%7> z?W?4{9{}5c<|6Yh^)WJAEX`!zLgo#_>_H>9EodhHYvk`|o4Ew72#tvZtwf{f&`jpP zkoi(%WCt3#Z9y~nqvYQ}(7OQb2%fnF?Wjl*v}J%p2aRb1v=LlbqlX;i4Dh!4MNDk6 zBubD{J+aJ91MLgy(lmsi&6CxW@~ohlw0|e<5tcheZ{IvvH$eLu&5so{lev@3J&}=T!G(T3*Oy*u>ejC%tcA$~l7BrJToBWsB zW-dVsKz#|?LXje9d627v#Z`~%6~(>8Mn+D4RGg7&;f5wxQy zk`5Zv253Kp$2UMDXMnfWscJW%4KP3(LR~%^Yypk(te}~+LrGgrV@b8NAQ9iC&LOh} zG?V#!GS?v^J4++CEodhHh2(#mpr>RmLE8)9C20FailB8st_~X0251Z5@eR<(8Q^Vo zAeL-!;EyFp@oC>PK=V_V%>@?FD9;L-Nn1|ZJX^heDxMZV8$xCaXeM(7nM;w89cbjX z1*?~rGThL7YY2>f7&0JdA zCIhsW4A4fRZPP(x+5qh&JiY-MIRm_{{^pZzK+88kn@e4;I?DnY9X|ExzI3zk1 zv>h_!c$Lf+OEa10llhG^?Li~AEodhH56E9S$nJ?r(4It(TUO7fM2eQS&H@_K259Z@ z_y%a?4DhyE|8X~@1DkwxF5(x0Byto4Ew7#Q<%q0h${Tm~LrI8=yT1k8glR&H!(#SA5hBXvkXwElgeh zj9OrTMtN4yOxi}$PCz+qKx@E*LiLS^Dty&2O7C;K{NRuC;uY^y$jG>254>rv|L1BI%rHA zpcVeb0vb63ysdtS+0rgSgFn?Q?HAPLPPFU>Xq0CK&7^&Xw0~r|Q}p&NMAr?V#l&c} z37X0LESZlZ?y>`o+_s>Z{Lhj98r#gJrR73~w6r{t5|(BGZI~6bFW~Ww>PgN3Z>!J# zu^Z6Pa%-S%rY@Bzivb$tSwS;te@EJ90I&^cg~%A7y+CG5^)#7ZA@dgO5oZS)xotr+ z`CG|9%rvLx9(<*4X-pfI_6j_{0U9|2ysh5$hi*VatfhhW26gF+vKXLI zo)t8c_V=U>(pXY0Z7=*NKwCv-3uq?uZZbEaTVw|sxotr+`QIY{ae|(bxdbgArIwaf zAX2on0{BWDG^P#EBJlVIXygp=wmN!$H=rS^*FgINb=i-8u>l(8SwS;t|3uo$Z1wg% zg@78MO(e4gG?V!wGEYZFcA$~l7BrLp&*a}i(7OO_HR_iHZLLTVwE0NspfPQLHWeP< z0F9gh-d3~sbpsl@a2jZTr7pj~2#f(59Y5zvrUbcGsCgN!Uv{T7!0nKDSO6Ebx z$PP4e+k$5DA18kkLGJ>z4Mz2R)~KFu<6-EaF>Qc0kn3jjp&@bxcw623em9_Dus{PX zZ9a5ajIllgG|IDrX3}Pm_8pcxMQ`6;*?NA2=En+}$(%*z&oB~e2O7C;K{NS#l7G5w z=CXP&gQ-YMTP{+xwA~iam^MH=2#;@oM$Q0ltLyi60~&^7}mvWTF0FCmjpqaEj z(mn}*Z9r>~p#74}7E3dkbIH6JWBzuak=qtDlm86z53QeM8+d#JG;#)bTfOf%CK4A3ag3YtlK4ry+_s>Z{O6JXGlHIyxdg2OrIw(L6)A!?3lBpFjcEh4dU$*TG;#)b zTOIyxH=tq2S_AD8>hcz*7Y)!T&kCAJJDju^+v@F`2kQoCW5{d)&14=)=BtpA9cbjX z1bfYyi17SK%QNn}198QFnGZd=ey{%Z0!5cDoU+hBn9 ztO*)iya5{0256^X6_o)RIRhtgTix|mH=toAOapBub-4kDwHcsMo)t8cb~b5uu-qwn z`-Z{90owa$eypIG%=5_nXRkeIkKru%^c~;O&+Et{zmd26_+7Y+}fOZR+Eufjq4P?F(8QE1&a@&Gt z^50ATKNIwn%q3_J(Pk1fr$`aB4ogG8v;o>}@c0I3x7Dw9b^}_m0or=%^03glzB#v+gR>Y&^o21?MCxs1o4QMJ{0xa#PWVTqE$-INizvyWX8o6yjGx>LszpriP60}^%kf7y>6hZS^Mmd-^ zKwA%wZ-7S50B@_a-slFjiw)4;r!L1_7SJfq3Ytl~kF+yrEUA{ZA5ROQEg-W6G?V#{ zWL}Jn?5ZcZZ9y~nKP3Ntf}WDO1Z{#CdSpW|QKSgk^Oow#v;o@9@c0I3_Q zZ553rwR*lJEp0ZLEufjqWn{hq8QE1&a@&Gt^83mE7C}$RT!MDM0PPb4v=&S2$+Q95 z_3-!xXygp=w)(xT-GEkZfHsc0aPJ`lG|IDrX3~x)?HRUu`?kWmVQGbAwt!|bf1k`H z$jA;fa@&Gt@?S~*CkT2Mpe-_5&!EwIPKR8*dNOT*RM z&iB9^o`x3YQO-BO9KoFGcqyf9?)0Nn#T!^Emy#`BsN0TxuSlAPLxBV<^7J$|;}TxT zlRL1AH}5e2%Tp-k&N;q!_Jo;jc8`tv+dei^`?)Osr^q6u`0{-rysnd<^rnzI@%23@ zrgiy$Kv{0QUWqqP*22&evp%DljPi9MljjET#BNE=+}Nitb#)kQOv`XFGyLf{BEuc< zM2Q&|$<Y1}&twlJ3Ws`PuDf{-$^xKjX(Fu4xtdm|A6Zbr%XUq8T` z*P@Vo9~G~W9}8YQe0f1`$R!UD2=?XXi@88Td-+aoF*MA&iHh7o#bzT(y!PuReqx&< zZ5uxQA;f*$eFQs(RRJp!WxHwwtb?-MOq_^^a@OBX;7ky{Qmd6YT)qK3cst95BDZIj@CW{dJk9fv^l$Tw-L{@7WdPr=lo^!f zA#BuMyVPDPw9jm0Qf8Z}pE}?f@p`X4OL-DYU;?md&&)xzO6K;=jnI86UOH{hF;nx9n)gGd<|DQHCZ+;N)nCKZLZmiUF|~+vW0?vf<-LTdWlRlW zYB^H*h3U4S9ydU}B1!3R`Ce!Z#OL!%!nqDf2`5vEkL6IZcOb1k`->DnOxcr@WD7v> zf~D}-bo<;)lJ9j|@if_|B(ZNMp6XA!%W-NFOP~UNy*+a^pm5-?J(HgseT2u!YhR=x z-uZ5J@r9z{4sWZh4HLB}KmAjdGtItXP!IFPI?pW%@FAxJ+YlHMc-&Ws}@7JhT z|J16ai`maqN{^ySVxuMTQuVWV+<0qPQ?Mr~hGVlqajy)eHShJ}y#aw2#(kL~Z|{(- zgJcPMCzgP1oG1bO${ZZI!(CXgIZZvX#%?fPbTMTvuJ!pcmjX-i&r8$Y!q4XFKnOW_ zAr!5o&RLMkd4a+C%Vf@qYfR3ZRL=PZ=cZ)N5{tHDQ#ltHoNdXRdo6i3q;mer;M|$a znQO^&WGd%}2Iu?9oK+Uiz48%Rv3&qfMn17mk~t4qv^|u{`9p*AugRPRmONMMoMyB{ zV~}~C=#Fz!DknNn8fW^vBuiLrv4pKUCwFF$P0J&wLNd?nWX^{y+U`!}eAM8~P3Amm zK`1ZvsT?&p2PJdvMz2k`+m_Tkj~SfjCv(=L-=K3&OwE&>cv;Tj$(+kAoE@oo78smk zlR3*Q+7_nfd4a)sRWj$>@cg>A^{Jc}8k|=rb3SR|EJ@`oGdQnL=6qHHm%`;$dK9J1$i6zg5RL(ks z^RZ;k=PlT-P364R;QU20r`v+ihE&ca2IsGmIeD-`TpX^2-F(rWxYw^s4E~N}{&}F*pU|T^r=3sQ(;eqp{n?tFD6&@L_9b)XX+BBWjh;co z_ZYL?6SBHrlld=+%+|A5>aZtq33!$Ad;!8qRL82S$vl}Q1G^`uiIZ6n#*AF=)zvc{ zpP556F^72RLO4EbP67kOCxVnZwB%G3hXn6WRTWcKS~)*Y6qKN zD0xIj-&E3+{r5!KI6ngx7cZSCR4o&qv%nuO&8OGSlnUoYe7P+79zAe52`RDB35uoZ zeRwY(iUqw)D3&1=Q#Hk;|BORMQWsywU?TJoJJBU{e|E@y>98x@dE7}2gB$Gc6hJ0+ zE;0@eNXH%}1Gve(wxLz1U*b-6jFKaz4^a~wo@)t$dKyjqeMY0H9p@%9#yKW0b}_GGn&BXlUO1%tXr3w(QddX^~>MHo3>(M z24@c>bIJ|5M8~w5dlPbtDwlF!4hj{yho9nV++n-9o^oHlP7%4sNOnnFU=kb2E{O|G zVk6ll@i3FvNOnm)(j+#LbGo3m_6ayn<0d{hhza8rihu{>IlXJE*jeM&hc_w$hQy0C z$~`P@;>A(QJuFt@#bL@lR6p_JsmeW6Gx1`&+@?CALScVjxxrYa^H{~ywBVWHOX~-MQkk?XmKvj7u~ZA~ipBP|D~5q%r=Hd% z{RN3u-$@q{b|$WNQ5%%|DnKVi-(w`ZBpz!L8_6z-Cz!-WvPva_JJk0cYrcs$-Qxst zmFkyuzfjcueAIvJ=P2twkqB=skky($_|K;93vfg|W2y@x0hS4OT0N7MX_ciiX;+9vB8{b5Xfzhv*RB`_Zd2d6 zEw3^v4|hi8(G|$wx%{0ge#4)|7v&hIHlsZ&5&@M6{=d1_`8ue+K~6SkT-gBF6F(s z)=ocxhl}MGu3bPV{oy26q*6NPuDr^mT#0z4{O*!0Pa~7x-MXFR_@WXKg*CW1TdB-V zypp3-;tV(|jnz-cqG-Xu06iGU5y3zoYcLR6syPN_l8e#7_F!&%C6@HqRq07Qnhdvd zySSYvZ|B+HPO4Xl4bs0-zZkme^$RD8%b)tA(SFKDU{(xnO3LF~{N*GMmC5~GAG!pw zk2a+zx-)3_Efv7*c^#dJk?#Rqk8+pGv9yPBn;Yk%mT(7takzy_BoE_wies^X(=6v@ z9MMj2yAmh38JqB9l9L@|+kB2OpWmRPu3V9u;$kC9aud~m>AR{Qr`S0Vi?H!UIzmiz zU;P*-x@GsL8;#Otfpriy+Nu6_HCWW}*VxujpBxQpTTy0^><18?GAkIlF(*;$Prj?x zF3Q}1K03ALxG1!K3ZwMjLF-;*y$P()I<0H1-6Z=jNVd`1ov5|D>^quDU&{O(W0cey zU)1`upL{2+`;+yz;DOdx+^b`Ko`JPCec%I`oe4#G=C4gjyon_#`K~27o$3^7B>|Q! zNx^q3Ngi3n@}DbQHg@bv)M(as)o3uqJ_1u9wy;TR^x%)b6Sn7&btYJqEAnhKlK#Tq zse6Wo?p4CNZmns&gmN<|x7HQ@GM-wwP14~c-HSR>ygmG7mgnDE@wsx8;wwVDfJyry zKSaCL*{y^MQGOu-2N=?mc^+=Xsp}0}am^4^gy}M#;+d)o*6?d;UqML>DHLBlMiY?z zmroN%3_}#*;E-hVG8wM~BMyltCk}y)rXi7X1g7?M3#5~M)&eEmjf^NJGynBahfflI zl~1zcN5bUMxjw9qRZRt1>@F7P1BAyXW=P8*u zus}a0bDCHLaruLc1Dvs*$~&k}3efH1jKh~M8 zFhp$Gol-4RKogIXM>>c@2>=V5EF2Y!E!>L_ufitcoK5sJjDe|Ps8$|>3HR;96VtXl zWrdJhUq*kw8a20BoX`0#+QCU~k*upSp2{fc!ZO*z3cEb!R$Wlm5e1rh`ac~v-%C0Cw{PQPy{ zF0DoucN(?*G2~(`(tJ)R`<_SD;5OVYp0*54HH1u-TC!}R@uGlUV;vB}$;TVn$caT%yr{XhI5tMT=9%}R?6}#4wooz!OGsbU$?n8VbG^O5a&_9Ufc5=kX5Q9 z!l)CdQ`HSn-Ts=oZbMyycF2WC@;IsvN}Gb94CKvX-$XgLu<~YeIYzwn2u6y#JuE~+ z4(pdSukleYp*)eGsQ56Q3ihlo-iKr6^Kec^J`Q0l;ISC@@u8wOgyS{B zCo(+uHsE)>peeXM4To~)kV;wUC4+Lao4i$VUkB?M4H@gz#1Z6>?8PCMsw23F=O2XC zG*80=1YS)Goek^GX%_PoIJ108d=K4^TjY)tr=KSF$a)f<;(g5StZ98Z59xZ$E8w8BH|2LYgSnp3a`h=Tp2xop=MU<+b6orgzlI z+<1FpK@lvEB)EN^c6(}bn)gclRpRe5{8gsH(K^G-1PTEaZgg*vlM5EUHme3(Y$02;U#hMg1wi_MG(`W zHbe-uGe$3oWA@aoYlN4~wLR*HGZol#{t9y-Ct0okgjxt)PGPIp*YJbQL=(AGS8aX? z_^J2bDWCbV*f}Zfe@ff;3e6>@;pxst@sw}uUyf1n8k~;6$uISnXessPU0YvO0###$ zY~FUNudEXar6?mUpbV74hNbzkry@Gn)pgFz>sX#w?~vsYE32dxMo~ol>?2-Le4O_- z^cj$<06hYEnM?#LSo^6`r+MaSWU zLS?qAc#m-I<8ttY#j9}KWAQfuesScT?o4qy#tHQOSo@@;cL&K8aBTf>x7|7 z5UPwVD3hyvJq-tCP4H*(*zM3n3_&et%W(uohxj!`<}HTIYbo=3$b^d-OQ|VMBCOb- znFDFTyU+uIG3hon0|7;sIRuRye#RU!kb^X}DIzT4X^x43f?20zu}uL#r+_U(AYhvp z8kWVj6Gz1h= zz-Q+`8{gaLEFr?)_efV2;4Xt}B)K+`3r>GK0xU#ET7W!E2FQaMAn#;=47Z;~6SMSx zHp5&T_?uNUJi$;Su z74jIG2XI>&t*PpjRQ18Lab&SLpWM^98bnmC!eyLLzD&#fDT;3>;Fp&91|*TWC2!so zd5@6|mdso4$e8&~W4@;&U)wOhcwdwyrD*MJQ~8QRXfW3AW6U&?&1LV&WtmBty9W!I znK<*359s`gC-=h#T$sT~}zZl0`TX81E^`0604%e7^qn1ki0&ptZ?GC7|j=l$eFz1>s1o$a8d?v^Mu zZqYRE!6|>D{-*2omn)g%Yg&xYU{tAf*weTkCf&>heW*n2hcu1KsE#~Tu#w4!3ZBQ8 zQITE}1VeYDHot`HFxKLGgwqD_m=9uoDuZ?W1`5ksz(Pb{KMSN2(RSONv|79ec1-o* zY^<-UWuTADd15h)cQz8z6NG|EUSPhidWTdUno~7s-hwZS=3DVoXih?CKD<${X3*Tz zI1>Sv)c(~(?cLBGkZ_=R#VB{8=no(o&BO8n9JM?Ul~$b8jNw#cR089bb*N;p^V@CM z_nYjy^6l!psISGxgfTY8m2IAJttbR*Z=u=`v8!fH=Ol*@<`U5p$O6HPH~L#-pw-|) z^oLl3OPYs?R1P*rD3dj~4@MY$O!KM5F4VkQEhDhq;?noDx=a}X5~{t7hQh1t#)BT9 z!(=M)l_+QQs_#Jsvrbo2>R!A{W{i`W9AASYI*|12sqR76d8naU8(gB?&Y|P;c#`j% z7&`7i9mk9~yI)>okcuV)qY$%X2D@mBZ)oPCS{eiD@m^S1)94H~zYinnh^!Tta5o<{ zgLhFCUMhH-w;n6lk1zFxyXiI=z9FLGNRzA$eWvJjnZ<}+J3z0Ap2k-|L}kr3+0*#% zxMo#E#cwEL(c=?xp%l=ANukF9B%lY0)#g=F4{a!w{vg&ato8=3~r=0Kr!86rU=aVa)6H6uTgTn zmzt8(kByuzn5r2?KN^J?6nW+@5gB|dW~Pv02to5G-q?$7Kb?=S0%2xTr3jYTD4^}f zSH5}}&Kcpx&}94{GZdO`m9;|1+5t}@MuQ-t#J|PUa1Dk&Fov}*DBi3~5%z>3>?W(Q zA_(&|4koYfZHR=?3u*nOw9(%xZHZOdN2gKRdkl1Z523KA-8dQB(?CVlV@vEcd(zPC zL947sge(q=W4H)yn6BAkUg=Obe5F?-6;Yrj>}wU895 zRD31IlMI$Y%JOfO@{v_a9;5_Me+5}MV*Oun^2_~72EQ_2fmtxv%d4rvXHgX*uwh6{ zz<1#kE^=O0rGB%3<0c$5xX^ywWP_o6|7n&w^7N??jlnT<45h&eF{2APh&O+lIwWPkkgDI&*)l^XaV4(GxaXqVa+>_`T z>Rno<*@fc{BI?x$|JjA(j~B@q;BB?P@LFAVX`eMRpMgR|J;*%8!Ld8Lq$jjmj+vQV zvQw-2k)3^q_CF1gizxCXA2<^`v~f(;ch#YN&fs27?v>=09ohgonKB$+C{hfEPXc0~ zA;Mv%5kclK92SU7U^Wbgb7BaG1um2kAfft|m}lXjM2-lD&yaxuvu9w;C~YMb_+t*$ z7j4}xwUQDOLSa+gdQxvBH3y^E*MJ@9!%;<;iQpwfdD@T^W+T4Skd&wK8PvCCzHz3o zo7_;)iQih6_9&AN74XZ_G2~A~p^p`uL<0S;dAEr=grc(Fg@Uqh4?tbL2f#u^|K7ig zAXFMO{CH~khG@yt$hjoZsXYe?ty6nPQm3}gS^yX5Pylpn9ZbnDi~hVS^d}+pUux+$ zdKznuj_psA%Wxsekkqx+2DG$kb@Oqp=i^EPJqm_n!-G8|SGkRn=E0%m6YlEBtou=y zBRTgf?};LyIfrY+K&N~pk+Ju)XFF$^MMHfM&dlq-nAgMoP_>c+{FJ%|@AoaeT2t%` zEIxa+Inl=uW7zd-e}hqg#9pn*zR6@i(buNhLzQ8TaS{2V)QI{Vj!pbP01Q*g_YV;3 zp&I^zOL+WRF!z0Q#yQm>!{3xq>*tNy{RJ`k82Ku1D0>kH+l0Ops!udn!`>sX2R(#K z$zijRLvamqSjCcw@a0Cd{3T*zmcJgm5ht#0E!&$v#SCSHods6A3+ z+2Ag$QdeBV1{XszT}@Q97#cl7jq0co8`_Blv#P~p#Th*XJeGzw1=?0a#s5=NG_wt0dp(_91it`m9zxAC-9oV zzmNQPke_|D39!xJP1=H!>ubWh;&I=T96Ul7(+M+V7jvNQ7fm4_LWrnnyEv>n2Gb;q zXb}u>Qi(qXvGy#TSdAFZLU;O)n4^PqGV$4(E1;0AXJCa0s3=X;Bq|xo@!#q4G!3E) z9OG6>HpR2X$IcShJiHeC9hO9ok6}}z-CAAnH2kNu%!%j~O|%`GgvAtcd|+h40Jq6Il3J4fy7OWpETs8ct8<;$n~Z` zO_vSY^hkN|#qr@-E#hfBlbV@x8%4+vwwnUuPDA9~6!~jDr^G<;7$)Ys3Iul< z-1m_?L~en=YQjW@$^N>@o(26!`gs}@=9Mt&`8U{w9{#0_;Jt6;HV(O=A@oMCM@}*X{Padq8&Zm$90Hm`F1Ma;59QOt1Aq`e)q+H;=G=ll%;+raa&e4OuT*WqpRr03>MyCIz354DQ!-eAr1a$6qeO z#GFll__4va$C@h_c!QzX3i0Wl{2%h}J5HVrdbkh}Xj3!KlZ(_`Oi5VrH zDk8$)bEq~=28omu8!Rrrz{@3@5hsd^39+IW@5Oo_AD3Qp@c02#G#MXz8XA$tsQmxo z?(O5ND6T)?5CQ}Z-m3fH=bSk+BlT4Vbf|F_q_U3>vBF)nvj)SgztV^cB*+^g8`6^@&h)L;U;>eC%<+-% z6jINI9n;vEU-*Wz@EUv480rwAIUfKst>n|Wb`DPtHcft;9%?!lx%<6TmuZcK_dKh; zt2HFc8l7Ru!cRO6TT+q-2#ohqTJ~tQ(xx}Cw3fVQ1s^Lx7;G4H*qBIVu)d7dWh`L# zp`{D&SAGrL8qkl+5zg-D$Dzi1Py$|-;v3K49F1?)j`I8)jHVohgaF;h*Z>^&pm^XU zditEYCd{ivar*%n?daw1fGM%3pkWkDU&7ECq#lpu;~jV`+Nmb<&kRRb;ZspO#swqi z<3G*Ea{1W)+v)q-LrvM)c-cM#0drmK^u(7Zc~tZ(Ju3R%=On1;BNb7ZQh3o8((`F%fn$$lOV2EaBDiG zR?R5ccTyN%s-u!45XseC`j;Y_|a7vbWai8Z9s=DZ1Z3h>Md-T>@pGS=A+XEe42pc0+na10M?9( zFJ^P#)M`u_D(qFM9z{FFyH&JZ2}QTSHWs*uN?x*axG3&$cuKb9i2(j#1=i0C{NN5- z&nef=My9-#YN8vZIL2EAUwe!&4Y`@*524;T7$?IqjChnUhFG7t?QhnRrkIaeOdOBe z#($WLIrWhOW#=!#Q@??<^G8F00+)%`gX#9(da>sMsEKCzi_lSiwzDUQsisOz z4X-&K$Q@*C6Xdzw;|z6+>QsrMZlr3-P;L4kBhVC1bVa!0E*GFP0Tu%{wpea2T4DW{ zAmp@tyupc=%!T-2NhcZo7yid9;D6+#L1nA|!|`r|+Ygm@ck*5RV_AGdRfpZ10oLMn zrCe(hqqx9*`%_-;V@58rAVL_y07dcPGR>A|%5DcBZAd1cH>N0k;zW}F73yn3=nwMf zAhXLv2Z3hJbIH+Vp{7IF%%z`D zh_52>mYrmH9t?FQ80s>?0EhO&@vej6(B?Z9XVpFqhxXuh9KrmiacCdJ4_+gMo+HOd zp$E({QXH!y57qaPK@SyF{Q|IUnl*Vcj%md1kPO+s6UK0W&Jt?8AB9OK{Ho)pY}cH{s=O>?LTu@Ti%w!f|psUU=Dpx}wWpe@4$k z!w5sY$aW_ZPl&T;587ZHz@m5j?zvJ4J1NJ}2n(qZUW@U~sEeJkUAvGDR;4hy%}3wY5MkrP(C5~dfJ5w@B|baIMF%67iV z_B^w_hu)ap&HfYwws#l9>MuyTA6H8`sW&<|MkeEF zg!L{YegW#E{lutCZnf1=3>L&ItRu*;xR7gb-bSeLNjP5{c44FPB&bn5)8_}cAW$oG zr1sVxXxegN1?YHz&UK6KVwR0U3t6bW8NG>ZMH=QH1M>`FEWm^se?-2jiD^{|y66pi z$q0&4DrV*whl35^N&*fivi0^BG$barIFv!Rp;bG%0520D3V5H)agnOX=6dYOD)Hmy zbftK3Ba3>6Zt3;*xYW2^fHw%R4ISXa4coW`x)XOH7FrhF>P0)@qRF=Z+|S!!hZ)?R z&OuS<19zygob%3;gsF~qjrUxJc~z!&HiT~IJOkH*aF+#_EkFHotLGXOd&z@S z?NboC;dpL!VG&c+K6zOQns3tX_%2zDR96xFEvRMeY0FL8jEqi$8} zd2m=Ym?wgvlcaNLVvaGyT*^|*S*oLFVP{v}VXCVxe9W~r z+JmsfB%@fgKq-y$oz;_(8htA>LQOIuAte1y0{{GwKH7lr9gpR$|*=?LzJR zvEPDell|_2f~j_#F1rS0-$XdX<+KcCU};|S85s>PWdeUbqr74_LS8BUINtQ+Qg+tM z;Ai#WIP>8VepqBa6q^sn4#S5#&4(iMp%*_~hYz@_T5+}PrM_sSND8XJ&JgKqU@jrd z5WtYDH`o_L1YkzTvI0~GCDKx0QW`(w(ffTCmhIfR@ z1^X|-76MF_mv73O#}8b7apj*!_ud;e)dq9D>M9V9y?cx7qrLh|-xza;S5qr}horoeZ2@X#T-_i69HF*zU-qVoR zt@HyBIHuC&Cg+jNnT?!QpF;F2)NIeT!81*^KFlUZm04Wq^?CK0pXF;n(}L3EoMoWP z2>m!Eoou%ELqAFP%jyRDh4`N(zWaFB*dGX^;s-{HH-T5pjxm0P_u;s3%si%P=8ebE zMs{ZeZPBm5hc-e+`Pp7B16f5=Xd(|VMAma^-irv~-E|JqIz=5uQP|NzTJb(}5S$>V zX?;J0jhxZm12_Bd9rpK?WAJYd*1Szvf=k5BB;rK2aPry+<-=P0J>_ooY1N9C-EwYY zIRj9RZoS2zM#rK^ie8yKn7>ZzF>PA!Wd!n=)+1z;pY7=)n^f!R0}YQNnsw~4pWSAq zC{o&N^%;_Qbf^C&UwL;b}HXFAW}~AaODJhlItmxv?qDz5ojC7lZ;6<6D4NE z_Wwq7ex>g>Y%6n=eF#+?Kl2sT9q9Bm)-0;`q6ch5pF#a-dK|wHz1fxaj8jDzs$oLDVa7;Qj}?nAg!E^X4-W0 zR}lS1rV%pA&-NoC4OB;a*>xvcTSGLY!3832mVoS~*- zMVeYUaE4LrQ1v-cOI9;+B_^rew6=@$H>~|Sbe(l8gDNom+0@uz_XPxseV1~HcpL6R z({N{>3DDaC6l!{r(nl9i0)2)BJjwz_c2qzW3#gO=W_SvyfNIq5)!NJK1O32T4fe?d z=8=kZr4Hr==x_iQ+8-*%gqLg=@EQWX2YhwiWHUm0)-zx>>_mG8O`4`I@aWftONMoO zt)5i^4ER578UN`kkD;(GCt*T<+tlUlaAQqbPG@MI`LGgfX^HrQrkj(D5w9RvCyK- zY-D0HhaY(%HW`Q*A>_caHP#M$Z%luQO}yFU+=-k{6TihKKJ)}>V%If23=4hwz;LH| zOVD<29;BLA*=C3|7>7gVxeDK=KbS@}`qPujXF79R8PGe8*%&Fslhqgz_u4Iy3OtRl zdc6;xrMCtjM&ivVq_eq7hZ!rg8V};Z!!NyA5v-))c1kX=VqJd{o=eN|Q;5IPD$G;p znf7!no!}5gp69D=6560jYR(#fuG#x=P@#;V$q*ZaRnuOrk=K=&(41+HY0B#z7op9* zgJ7n-=0h8yqx@_?sq7T5wYHZ*dIyo-ofk0A^!oylKNOUhoS)-R#YwWLTH?{DtPgy( zyf8}FC(9K57Z%+QMQaK8@47Rs4}8-Z`DreSw|cU4BC~HoJ%rlRm3HnH`2>r!aXtu) ztqLgSm=3l~Ta=vZugukXFP15iGc{uPue^x6Cn4U))a5M}d8I=9=C4vAUcy{AcW0R* zasOR6IIzZbb)MSJ!#)jfZC#`vu(kbV>T6^+y zB9xCuX^ z5lefmp5aUcGH3Li!^corY!tjudG={1h)^op(lVt}EQf8N21O;@dTKz7loa*A2f#Sa zfMA*fVhIOC>`XNv_|QhkC_meO93-lRcR=(sH5hgpYS7dxa6r@@0NQfxGsHoLs4&u2 zkF1)uJQPgS7{VSmHR`eiK*en*d0EK}c3Xjw*tp~B2YYuZg9Tecq5YZcC{16$= z`&~=#hsPy!ut9Yv3poj>xaLyy1`uw5Z<20OoIVqDo{PJ?ai>ub#1oQAkaN(}thHD=kwrYa zlui{-R~%+4vx&t%#KS4p+o#f&<~{_yvzob_5a@TA?*+W@p@){$NJp=O)P585ix*j* zLG~#N=?i2C0!Ub=(g>N;LHHT-4hupUyi(NyO*VO@${^nVbQHFNeJ(3iw?lcQ`kp*$ zl<;$JvOSPs%>Y9aS6Vh2ID29mreIwB=>Gs$h8pi6 z98ZVu)(5XJiH90b$16piN7I8kkdF%H2bYX(5Nff^>cfSrzGq_*OT~e3vF$Y~scPqP zp??xWn3MIUo%17*a>08xGpnUCwM;ewOIZUU-LRX4p&QMexrD__3^A~2N&!g1UnsI>cg?7 zyy^Jhnv3MSBUv~-00)yY@3K_)0QhBPO@h0I)(9Wk2pQ#P`>0cW%GV%+@Dn1;1VUe@Q^A>&Ms{LzI#IV_ zyP8fR&$K<*l=U6UTF!pnU{@ZT*lupFADAnhM-U`y2Tr?*I(lQ+qmDMSP}L%9=pT_5 zStlvB$RyO&QAe3(i`Y=`?DOH$VvF#hjgV1(w)e;IbNp$#U&~D`3I>9{o$S}-$%`$* zl{Bm85~z@3IGqUu-Z|$iQ_LV1^EjCZ(Gp)^O3TxyL6jyP?WGBz`Kzqb^9Wf-Na{&> zeo4wnOwNEnD2ey5>22^ICk^!~Q|dh|^)OaTCg>eS9Z3}z>|TP|Jnvyhmyl{Z(H9oWvGRn{P zg(962mKR4EgdY(h&!q_LwK@c~Q*p!WBz*@(J=<;p8gJj#n8J3lu&+@$>kDfDCpzgq zSvAEqM;sIE0y)~Qe|3CQQk$P|$~o{1l=D}X^D}$$2=q=;sa%g&ZCk@qN1;^JlSiN2 zQBS&H7ZB`FfN>Ipo~1XdQ-y`z3^(TuqTjhQ(ytB1W`ceaVtb$^3YL`?| z`@gWGTDxGsCD@@Prsq5eK~?uMjEEtbvMDA~wB5cAQ$;G5!&F1SLYB0(hjBUF<##zy zzr3^)a81IXgLO=db}mcz%pB89iBGV^n^2-QS2x&s$Ez0b#3Z`emoPg6AbnE^6x?4O z2*_SMLIYf00$sE2u=tyhGg{8Nr99129?e22$%0M(_6?cAci<nDcINAm!v3RrlH|fmarA<7ixNjFgp^cDHezwQT5>UeQKgS?^f(Qq4cqETyDs6o_gOcRw|5h5p9*@n< zrm$C7*f;d;{V&r$cg?7Y`g4}Eh~@mu>HkPA{57qTlvhFT}aSTB}r3&@)rvLe-gd14GA6dfBoc<4@M1|AO(-QZZQlDd~ z6)07;M6Y8zY6%zYMS}GNn3?`LJ6UTv|55Mq%uo*)TwfAsE4TD*uxooL&T(u)H`iCp zbu@tdQd-VQlLgqOotSiYga+I8-bv^lH0TZ-f`YD6=(-S{#{_kA9mHI`tJR0j9F3-| zP<5jfta{}uY_ONJ+^_Lj58q{!(qeNhmlU=4TF6~z_%hAmTfpJ_8FUv8 zUp}-EGRn{P{ov^&o9khNZ~_tD1cZUZ_q?FtyFpYWmt7w*g=twOdCDABc^r1wi0YSz)}t07oY}u#o1E^<32+HdK4ai z=I~u+N;r`ve8OJ%nZx&d)GlfGK4(h3lBKqgd&MFh3m<)ILFR%@Ay_rQ{KNNIOcCDU zyTagVCD7rl!3O)O?y9Ax9iTiyZmtKBt9_zxFsU;Rlg943Nw`)TT(1z@<>p$8Tpm{$JfgP%1h_*@4TSaVA&XtDz9b$tm2!wb)y)j?bD-dOhxlqk7axL)O(6e8hzmG5rqW{S2QRPjXod?P8+wgy-o+L$J7jrg@M?X76zLmMHZ{A}m> zX?xYsb_!|Z;VVJ3?5tg{Y?hJ*LLo3{sD4v?rsvoh>gu8aI>=TGsOs~Dc*IYa{X zRK^Hw=N*_OSBM^r(K4#K!S2dS-c~^6#|{+P!d1&vJ*}j8P6b%D6Y|CrQ(8O#Jx#V& z^6rYfV0q_uKym>kEMOE0h+h?s_k0*!#mJTnM7DUbewB#zgZ=>GHbLtHJ)Aa!ZPjpk zUs4=SQB=nnPE2z+?ZQ_(2MQR6Iv?5y8RcjDb(nh2Q1>F|o%5b5ZzJ*t$=pLSaOG=1 zb$xb;iu%XCdUbvF4!WZP&vfA>+H33#SoA=qFVP;7gVweKL;lC1DbDt^UlKLnff|H2 zrM`G_9{KzLh-?g&qV4Vb`ouvXFO9Wc#&y}P^UyAcF7xn@L`ZqwBtN$dL@d}TKl~Wy zWt8|&o{w>#d0XyR)_XNA)3a*q`+xkAjR4agTl=|3$Wu>-nW(XR)TwB29!ihv-EQSM zh(4cF^L>1cmFroI{@{PGU#Xy-&=d8Bx5OK8xXKhflLcRlM{$w`t@3s#^j4Qp#hTLKbSjhtD znPCA0;eXt9hWnOor6}}qYV-3VA>m157Vh*7$immw0NKX1i8@_Eoa;vh`?tW}ewuY_ z@J6otWFyxmncw?(hVWJcp9v}D1ZLJ#AT@#IID4;&bFx~g&K3%wk4sb7aV`h{u*NF( z72A3h9M3}t%Jh(CtF zF!HhzfBEs8Q?F9<@c%9_Y97L#K+HgUWU!xZUBIT zcJI(^?u3g+ntnJU9Vc87AAPq`YY0(h<8OjBgjl(acf2)(hy|H7gj5QCYY2aYBx?vi z3YFFnf(YT(5EjI;%W+^H$;1&Zc#?XK(zl3n8!6fZMC}!t{TBOMuIdJ91xJFk9$TUC z#;?k%8WpDybD$ZSK;M_jd@jOuZsn4A>s%PWyayb))hBv}SJZa1HlIuU%-4zeN-=W; zikx}OIhr|7WX=kRs1!MKnUjIzw{~I9PgB<@hdIYHCy#_|Wz1WOGP9X;0(1V2 zIZNDjS1rz#3^PxZoy&a9$QP}^=;B%Nc{h$cYk9}jsl218~vn7b6cnUC+4_$|P11%3H=$ezI8=J${Cw0#f;67QsmBi9D*0NuE~nElOqA;0Rc&5=6tIIuq7JI zK|>f+BYSsn^%_oSbAV8HQr02DK^pK19>*`J2!$47)jEXit|61a(9n6i16@xcKbA)o zCt%c|xcfGsL4PkWIVoVUEtPGgTfcoWFR~9V-N|weJ1QUxIuGY|rug7T&wC6|<4Rs7 zS2i5yr|~S&cknMajaT4rkv-%!O%m90@|S<%rL4bcj`iWeew5Gq;2s$8X1?!*|7 zsY+Ri+-V{k39F(^J~M%n)Yczyo_s~5)}5$8(ZexCQRuL=-}g!n--f?A_`3mrSL5$e z{Efk175;|cuOI#j@plydR^abn_zNAH9`1|3-{7wWe^2A@WBl!XSbDe*{>I@iet3HL z6a1~f-`)88HU5sl-}b!p@Dlvh<8LtjLiiI!TmMr<1si98z%q$k22*$O%_MI zXtnV^qak<_WAJeZ2)8M4sgE1vf909S=dy7a7pR-=6vkU(7fT5n>DeFH9+^1gmKR2$ zAM@fp7qOttn0LTwVJH<^?(70!>}IkjPLtiP4X3`=m037Y=w$2!u{OmAr{Sy!Oo~C4 z)9Mk{+pwHo6INC6r{u+L7_M+ zLyGXJLaS$uL095`bs#rGWpun@&yDCA=irFvpw2o6N2nvcAfa+p1?MN?yp%Y9#frdH zxxs!i%(3V9rwAXUEaY+)@)fpc(qJO9`3P^mkFQtH8co`T{LJQABk^F#zsJi5N``(f zht9Bt69i%uN|bLnUZnF%xd+9*^55jOEZ;_KNTEn`ey7KXLjm=Z!t0LJ=4lGr{)%Kl5k0@OJ1)f99KF(DTBs-O|IoW%Y-=fePeSB#KESb+&A_nR-A;F!Q^T@G@G2qAg5!Vyv2%r_Fo|? zaNpRtu|+E`SUGO2OgtBuj?jHDbK4w{=a?jokwy~R7`cT%w?yXRhc-%lF%2)+5v4^t zagZ@pf7pUW+wpHc4hgG(W>5ibzXEIx|0DiN@Ry?nD;0W3XpcBi{4(Cu=Xb>zmE#!~ zK~cI`%rg#e;c)RmUu2+L34K2%R|QQIOk>vmz<{fxe{G=uO6ZFKJrOg?Tbu~A zKQ91koPm0ZP{$J|og8mhSu;zCHckCnJ+j9j^kr}sD9UcW0jccfx*R>W)gT_6oA{V# zKau6KzOS|}=2wV$2SNw}<`0NY*o|0XEZW)dLKp;fvTn=5PiWo>G-C;zxo6Mldw5+| z(Tb9Ro$wOvdTN#OVzQ3{T6vPG@pXNGcRBE)q)6;Yyw`W8Y_QkBYXxs$f(ul2G0$>Q z!{K;>-vDs!04=2-1nUXKt!0wprFpAhhrl+IOY@k9{VI1z%k44y6N$M)TJDfx8Bu1m z|1NStcttMF^R=H#NN*Cdm|+n-#r(qUP?_lG?*QUNLX0HDU|yhy!xYKj#*aFfHYh@h zai28wd24WHyp#1BIKk%B;yJAf200p8c6|{Zh4t&g`=monf8=0OMs}Iv4p@;v6Y6VkMA9+ZVKz!NV^p>jcdG-p^s9DBS9H>Pk)c5|79 ztzuR-8ndsgMG_Ml(^VsrIe0wrTnjwD={$HOf`*8o0x!%Kf3G-s(Av3J%E0wicBi@$ zxj@HSi!9=d<;V8@TIr1COG$vca(&&Ccsk)xLbX2kQPF+18F??0?zg+5ePksM#pSoo zfp}8O54T8)%MXR{7ohogf^l!Ax%?m_?;hxATz-%-N608Y+rwooD#Nm|J2GJCPca0% zP69@f0F0lVdfen&7iPhee>l16HKBR7bOX@CG)Z-6 zMPxEw(Ct*)GNcPHWPb|diWjoazz;6)855a=-fpM!7!!lszWxfnB=@*W_&-Q^6Wn5o z^|5CF*%R5{4Bq^fd660X%sEg^qlzqrUPx8bDu@G3oOMaAhs=3+CHD+TIj`BBG^K%j z=~DSQsr(4am%A{6b7h@VPGRRPL%BeTrB9jOQccHhi91*#L#R+DK# zt~HlE&1tPbQZ%#+C6%pNT~)g5X&Tgd@+H^aOs~J5i*-n*i!9?;Kt^Y|-#)=~7BIAM zd_MO6{T=bOO%F1~3z0`;gTj znw!6FLoS~I;b{Tr1GQ&2yg>bTuTWD2!a4qQA!+GNb2 z4P87r3y*YG(*Ig!DGJDPy~*-hX89+uCzs-8xtLkD2V}XYn#pnwv-}xZ z;!hXz-?trg(8mln8W@W( zM?%djkxx}%xyF9#7QLKs7}r7=I;le-0OWAdbLwH2&iFmqs6r zze4=s@(%H)`GX=9WArsVcJ#^MvF*xi%k>+5(5U^|7*BIjtX4?q0t4+a`t%qI&>8y~ z=u-*(1*{P>@=}|MB?hXDP|Ik;pq|z{!Q)Y6ZBFwQ;bts$jZGYnLlVd1kUaajpTL8f zVxNR@F^?wZ>A>t4*pni;7+zTHDB9BSoU-{^T$?ZaKiGVOO@+G`0qt2pi@7HfE5dti z^Sx%jC5n8I#yrS?w~^|-*?5>!ptezmN z;^?EwP=yjpk%=p$OiR zw>N8`DD@w^tm;LSKJ$WVSE%V&&}zXy9m_$&n12WuD$Q)z+A@HGqwXA~@Zp#z6vP$d zk)XX2v{!=m(aE%*fLTMcd#LF*#{7Git&M$OacRI6ohwlet^)R|s{zB=?X8aqe;7?b zRabLodJbNcAbyF)b;fN%D#>(>z}v8`P;N>u{@zgL7dtMdFNx_tuw{I+Mc~N9xHL9k zQ-Tec*O3jF7hnVC`8p}k28>I`D?T{ejKq-~$RiSMz-3rcQ8wUmNzn!z3F}VVfPI*z z4Y&#;&c3U&vH|(fM#v~X+rzN1K;Fhq)*w+(VF(yc0^VReIL4E6uUNi{K|7o=XzLO5 zff3}Zr1-hbc&WPv-A5a6Ji3%N;CMVUv|xh6hBONE@M2QSAh7`%phL&yR9IH^ST$a6 ze~vIi@*u{K^6R>KifT5O>Z?d~H;)1M2nr*$?f?ii-OYEP22@QYbwFP4P{S96&1yyk zLE082i5Sv~v|Gg2D%4E{by=D^x;=an&82J_Df=x=G~@C21S{i?J%-)@qhs`?nvUHP zZ)Ax)hy^8fX}%!~cZ1XDgKKj=&A5Aw(RVM6J{l8c_a+&A_tNN#$d_FE6S$(|qQ*BgQR5q$XRrMR<02Jh+)|;Y^uEO0N;dE<+d|ncijT6d-X^j)(E{ra zFeSxUl-mztfn^7bHmF;{CfF7n)SPVm1=?khX2It@2Z|=g0-Hk%?8Fby76|T87TD2# z@-Tji?Z3PwCRiaS8fAi|u!JCdQ<-2X1KD?Hf+fbQ%d(gguRd%I4XPRFBacBfb6X=` zIQCRygrBjHMzc#VtBFbVH(5_ZbRX8!R$zLPXgRrVhpTEdu^?md$JwMm{&u&PwvS<) zJ5B`StfA7Kw3a4ERs$7G0_VJ&kbzo2s3vO20_8EMQX58L1N{)8s{n0=krISKj{6=4 zYB8Y>QCfLQ_r@T#hIT#949aevk~p~h?u{$H0z+wved5B!yo#8|1GA6A!HqfA0Lo6x z5c%;ZDNEhMC45EhZz}V;(**G+MQR~Bm6F7qf1hn~Zeh+kr&$*rNPX+7dAv3dQnE3^a6yN0wTu#t>cMb=GrPhfwzsihEtb^VzUFu>}1_^I*)IU=c6_Bb6iCxGuKNrEyKC-m&mTBgU!| z4nj`jJ=tOFjEv#RrpBCu22fX60T#tL2DMhlDNxH>&gjf_pt~S^X#5mEck-h@gVjqMDlq?U#KZ+4CogU30@AWSsF?$ zNmv{3bHQr%%q?VU>HOO6SS(P=0$$)CH`F_~syTO-tO4c2)lo4kY;9ID>lw5WSmm?Ujh!omZJ2Ze5Hq zAq(xjnQA|y^)2+AdcjotNv%AVLcL(BJ+GB#M5q@`wTD`Z4G2>(KGD>9=t$>UUk)-g zY^TE9Rl~MkQXIC~u!FU=Jb-C4Y%hh5XND~yqx@{=eW8Xe;|=tZ?RJm3UWj&5%HK67 zq1oPst_{8}dPO{~&hRL(uEknX?NMZ+4TzZJ&_J9)0?AH{fjcbfE+UhGqb7hQ)cPq* zWW3}0>ExDyVk)=DFsY41!EszGMK4F{?Pvd$FhoL4_aU2e8{cdYTC`nG?042k@5kpv z4o4&>-zfs>VGYkvkNMg#7BU(|MFJ%l0uCYdAY_5cy`g!L1S8qoaCMSr5Y+AOkaC+M zyO=DRZZDEwMtc0fWgJ;>h1nv zB7!Q^$TmX9hnlEvdik~e8owItFNInqj$YKEwv9_r$cRdioEKl5WL1Zne}|83Wwy!5 zhDTRQd%KhdHhQY1j9^h3yu#yH3=?QE{K)BSOr%s<3hR|n1m zZXdvWrX2`=mFstf>9uG;hJOo~Qp3U5)c8T?RC_rI~o{Fof(wQ`mYI zb|ng{j4vgZk;cTk-h1Hq!B?QR@ly6_KAnvB6)LjcV@XG$q);PI`iL*3IhC|9?XT9y z2L7Lf|0mDk5*=Iu4$Vq$fF|<~1NkK(xA$-$J%*Cj_XD7LUaX?~TS7k$=ww|!0BWm& z>RbS*X~YS&CzUpTC6|EVfVei?JZ^V-{LoJ^inN)e^+Ffhfy8z@u=%BiOoc^TTJtca zk(<xKIksjw6C%@`5HlGoRE;n@PKbPHBXpFX?GWY`PO*Ujc($qkR8n*b>u;vR zJgqJMoar#nXo+oB7ALw{TS|y zqVyKu@$LAcq@qh|Gf7>wx1;Ro(>oItzNrp!PR24JJIFaB6FFw&3=eLG&TX*&&1Eai zWV+K_ytfl?1@H!nVa$7f1F01$|`-8e$4cmx8*7nqH>ub*rZA6`?HDxEL=TJ6KVtWu~I+8&lwPQ{dm|u35{Y zJAGPbzX8ubb{s6-cN%o}16^z=Foha>ps*zAu7`kccGzX$ zA0d1b0D^jG$(wNpY4Gd<&@@u11ZfYjuj_>qRZF-oFJP`DO1416`=FXvij&r(bx*kM&p6UE~Tar2I5-agC=wb{q9T#I}K zjtG2%O5{u_*bPbt1l$2|Kwz!!9XKGkGMVgvphwGbKtRDV4hZgNY@GmI8G?Lj>n@P! znmoDMSgt%XC55gr->{ZXDIc^(HWW6rrm{x=aE$-7Tfv=&a zYp5H+H4(cQ3CB!(5_pnVGHJRg%2lMQL;O7E<;R`ZzK zFy5rHn82jN$`BJkV+bnhZ8_+S12{n>4lx&@MT8r{pFV}jH|98hy=L!1+n{6p^POu= zDGBW2xPv&jItxaN_jwBr4_xC`j?u~Mm7J}RkUp{@Ai0=yGj<+hG28K|Sf311U^J=e zxRwNtg$@?u9mhg}VfVUGXeTaxmw?+#*k<_c-!d@W)tzwRyKuzS7~h(qal97#Qq_^f zIX3(YBySdErFNCoCvs>V^&=uH1Clb0tQ^RUu2df>6I_3P$L%kD>xLK4YU1I=cY#Y( zSUta)tcG$mtLZ66vzptSud$qWFsfwD{CcjLBPLEZ9Td=2){v!mjY-~=y8(BOC9#oP z*k%^ijKX}25`H#9cn(}X-mRky_f6xuNLMqkq+f%b9%_=E)tqJ^WQSw-EZmL}C${+p z)%ux+HFCLR@Oz4iM2I{G;%o)c)j)J5MAQ$F>pOgCvN0KYb^H;V7ES{b7$*6*oI5-oMrsOoQB@SNV{(XW~y#z z`Mc;huwC2S`~WfcJJiIztsl zRKtXBzrfl7A0rl*BxEBaDf2rf^RJotgc0^7KmwkK_vFbjqAHx^cJ8vxCVwsRI~yx= z*jg>mi>NM&w;yiZMm5E!L^R*e*Va$*t}c^!?{Zm<`wl(zZ`hV_lOfN4`BwSci*O?> zPG`X0hN0*gNM=M7cq-`AL%DrjHOabTF-RVSHqauwRV(dlpMr(swofM7#|OT`fPYBv z2>{n7jf(kC*QQ-0Tw9^aO6@ONY0CPZW#wqa1fx7a>2m2}zxn9mHMpu;;p0%&I?Q>R zpitu$Jj9=-uSZ20qf3D!H>jA^rkEpHOp`#0HINXUuSL`vle;%_PsOmq^n$IZVhbch zGzaLWuNdf42wetf*a>4b(tFaRr~kFqKUpam9Jq!2!cy_cp=BZ(x+CvU*(1 zqlo!*VD^b8WgQf4Z=H{Y5!!poI#_@wWgQeEqbR}aQ5IV}w_K^rbr&tcO z4mOy!c!?Bk!lTyiA=B(AwJ+-T0j;>vK&~U?6hewxPu(Wxf6#4kK9W}D>*`wzFhfD# zh;Y7YT}4$M{(W!;gLDfMJVf=8d|5Ur#AGuE^4n3}bs*6PB<^=$+!PuIW{gnNDHJ4B z)Q?8OtQIDO8`f1jG>O9H&{V2vD)TyyaFUjgR0@)wdQFjpg9<}UQ_Z^JXC#ZKG5QIK|K6(b)hEj0x;CdzGE}-VO}Rv z%MVP+2Mi~5UvHJ)gwzg)Q#?)f7em_lo+f*kO?Kr|rpYdpqH*iqioQcKrw?iwmUT(! zurkQAzNHN>a+YS$Pc{x+|0v!K{N0oF@@$R=b3^R(`?7X47$Uphkj(nO`^J;*0BZny zz;8Ue!_BLcLj6*tN&OL5Fo5mAvY&&XS9hTUbNl0l|FCZZnp^}oM6F>?IBi!I>`EM5lqDe&nKkjQb|;=q(-qS$#%GcS=y1!rb>wer7Q0Yi4SuoW zR`P|OuRTW@DFJ!E>4D!L1CMQ#&(F+Y2Yi8Bohdw4fFZ40gZbrozE&tveL?NA?>gW3 z1J_zl3w^SawRTXvs~)?G-FyrwUz>%=<6Tv!d1^n-`a4JyosU)2>d-qbf2k_|-c+$n zs>tVOqO9WHo+_e`gx(r=yv^LUk;5UQ5Z6zyf`e)uE87@(3qK>Q1(Emh%kxX7&@Tap zDpYO6m>``aVU}EM;Y8XWf2H{25sMZ0;P@`dLX%YZ+ zkb%lL3{amP4uqUyQXW^*To-P>5C@hddYt`7m2^YotJ9S}1>VJ)L#%%VR{vn71&UR* zY^#sNsZS}0zvHmKZrH;N@kgqJ58!YE(3b$) z^E{2J`P2tPr;+OJL4;Wd7-`ZJj{NDo6a5OV%)*hs+s%NB|Bhx&nG)9(d8^x0y-~yL5HR16_aVCAF$V#})>< z-QE1%n134bqnW!jUzr6z1}A*(y`wKQYc?Jk3KgbfbT<8d#Z{8b#;m$@rAvvgg?h5& z!%%XNe?8Rn4Ze7%^4KSQp`!L40QV@vb)lrla&tT^$23`P30dxM>lDlJp^cDHezqrK zR3@=pp<%f~(l%UCfVCu9arqyNPM72AE<+n-!{!`~HfJzG4t^1gkl;`sBi(oS3Ljg! zgbgHNpC3Y-Ez~I2D)3f|@6ymTJkTeGgyyQTNnABd6EFdYCujnqiB5I~B&@eDq9;*{ zt9umtxcJW`{)xcvaieR=tvlGwdoJ^yCbT+R&&WD&1G#WZ6W!=AHNiMd)WPO>_|{k0 z`7G?KgM%g=NKUMT15X0GEWrzEtvY->>`2LB8A`K}gR?@7&!fexP8#WI#gMpNgJP%VKPf8uw;?BJkUOly|)*oqIk&8Go$xnt1N{K$67MMT{hg&qor(WBzk! zCy>z2T=pN@6y@R>yTEwHCLW$Z{R0Q6QuHLa5j~2Kf!wAy>KNh%-w{;29$T^Kuh_@! z;j2(iY!aZwcXplHR-3Ii)jpC1B6H~-dxVk02+4f}PJemkR9PyiTzfvEMIE(Q4^tOG z6A^R*0kM=jZh=63^jz797s|=I2uhu!o-y5iyuRkT z>1D<2yO6bw1w{GTJ`Ga>nH@!WRkU)$#xIlFBS^rj_Q&_4T0Gr>&8X|;=3LF3$M!@{ zap&@oNk^H(nb2JSljw}~SisV{oX4GjXbzC!ELXd;YpAJ3vp+avg-TM9TZJUGx8`|~ zbxh8aH%4b#AdfQXEuzaVkd7p<_?L!jr`?>u8D^7r&kmd=~({i1;r_E|Ws7d&8GHP#2Q zPH5uzHCWE$tb>krr?0aNr-hF|smoBRW_8(B+4=y4vsMTtMTIaE!`5MPrl}C}vU2+Y zh;B-BKC}@s%Fp(B7>;Ce&w};Y25m2*9Z0lh6~bX#95BDf5f)ySoq>Kui)Ld~<$)tU zRgYv_8%fQ!d<(Yak70@B@+d6vA9(6KY|Bu7m*x{l^Yi;sMui$*{T^N{>WVKSA-dvX zBs$_!P1iRrUAq)r;M5(8EdF@N;-ipts3wc|C*7pRkW1FDNY*hRi>HWyjT{TaBYd^g zaAEorhPQ^h;ug_9Xg#q(ZUT>TK|-|3n|L%ThPo2vgEhmeh=rP)cdhc7$q9&t|M99>aXd z(GNzI9FnV?2t2E%5F4{Xv!|n1;dUs6+d*y4dKInHlbf@crM*gR(2|#Lp*iGbf3-ci5L9^{hZAkRZN&LC%+gIq4Ue-$wo(q_cD?KAXTmdtj%S|yUj@z`=tz`a zst5KW%u;yFhQL{@l9WA5RI(6*`~fDpN(yfSk}U(faUy+~$$625`0)&VK8o@sMXk5T z{LKiaP}BRkPeF}3x2>OKeGl*9Oq8LfKasiwtuWMddm_c+1XdJp1U?W?is=(Zk`%9C zQc=7aNl=WJtC&*XJOneV5G;k_e(}X-Dho9oA3*SO5LCDpWEp0+}}U2@kPb0*L*9$XD+D zGiBN&!{2*H06!eW18;{i4Hse0TlMO)`M^w}rBZV9eT=i&-6ssf$dw-SW&?!|(?$|6tvSn~rj&RAa z9%DsWRtp3eBd7#fa8TLIN6pZtz~dCS8Wm6joRx~5)txG3sBz%e&^c%ZmLTDcn~NQT z7mhjj`+$KzOAY)y=$Va?3PmNWQK^!w#%PsfHO8nUt1%u)R0Fjb$<#an_Ed#sp$<1J z@(iFVV;ycxtjA56QkXN^cTpvc*Xh7h*3=0$*u)MTiQKLtjUM2ZE;(fBaoU4Cu(j-Q ztwTR<;wK)bMJTr7Uxm>Q@j6ea7bGclbkWqfN&%nfxq%rV@E7f|> zv8u;$(*qqn|GE|3wF{0OqY1b!<1sx}!0b_Q zHwFQJ^thj-k{mF#D#-yeRV6uK>XB?2*wwqhK^RPp%T>1Z_T0bt2K;8!Mh$q@Fm_%S zX@TINQn5PD{!&{Vry{W@BOkSC1RbD|Ke{$^RFbustCFnEJe6c^<|B#Pn0bDYKucu= zV7=Y&uxCh>o00!FHW?9I4y!XwR_DFa_I+4XDe1e_-G(J9W_-J zu-9>uVya4r&UXteV}YNN?N#URxWMWB zZzRRepMjLq`AoC(!8H}Q+As3-y0+-_HA~a^`3%wd^~RBGbz6mz1Zu?#qF}v! zx65InrnR<%q8Vi&UlS3s{@2oM^xig_UPRwLEf3kIFtg~BZhK7jOZ;A z31#6LD7k9=&S~75u@QoS=TCe&8Rt&m?_X2W!v|cG9`1I1dia$a(!*sl(!)7T>EZ8g zNe`zrr-%Q0YkK&Snd#x{@i!NLf5KlI{&eV^{EV`;HGH}&X_rH_RhQXP7RjusEQ+@b z!G+s*>-(79OSHVfkYOWE#xvTfiK7snuq_bEY1P~vLIu^kJ7ix2a5(_lYshSCtX=kP zfBY%w4z2x6&Z*4V+bRvWR7A3>P%PP&+vlp?akOlIll^97cfv*U$%j*J5k7PWk>|!W z#^dou$P(PYm_HRG;-43;MEz0m4{-N2qU2U(s3G79ltcD1hVfnim~XCCFlbSyJu93L zH>{72sJ33j8T^=;aH367ykP}(i5wMgiQ42=RoZ>j#npJ99q*ZwP6;1sT8xJ5i+$>~ z!|`u!U6+=ro!UDM0b#k7b{PnRT+LFR5ECsv%|2}@#Mujm0 zZTkbO{C|z#WfvyK?~*UHTIY-3<)tKwIVONPs-k>;W*s}=ggK@I5WgGDFVFL}HH-hk z)g`~Xjo%ge{PDYi2!s`zXG{4V#_zIcm{Kn(;GsLSL!fMm$AHz+hsg& z0la9zF}sb1*b!K$i@jQmmaT)dlOWv0Af+ag^+IOdSOn_ev58MkI*>IW`gWE9y_BH$ z1JuOqYE>`*s=+{AMX1Y&5TZ5J?Jv0VWl9*=zwG|zmk|qG&CD0p>SApo))Rr%w+mSv zuOvacwP=BBa&b3Kq9Mc0%ZktMU@2Fll=wAy$fm37LwmCUSU`XWakzf`nn(wC?pOxk zA;ACu)25m=eMsmFP*g1@Og>O(O!}9( zQs;(w(2?NMd5rMA5GW8DoMH)A;~3g z=kTcol26F`;x3on^m@5V))ge{1dyfI%drdLE&6v82dSICmid1=!Rw6X@;D=Q>5dAB z*ewvh(`>GmXUumg(S8iK7)qPtB*M=Z)0%0n>~o+ia`^^zjPjk(BW zIHt*PwRE}0p+1t~_|QhkC_mfFFesB4jt3hkhP#)vZ31n-n1{lN*p)y>=}sO!n;5ZM zF5P$KJReuNggr*WuI!EOKomwg=oNqHw`68U?Al0Zu1XcL%OHtLO~6R6qpChqDfl11 z)9ti-l;gm~zm)jDEJ$!vX~C^K*v-3~c~>Iu9{Mld@$jv$u+=Q=8WiT6av(QDO=qJ? z61e45zEIq<4Bf4`Wx1q8JRyw0h$p1UEjD<=e*HehEqrJrWOM>P+c$%glemSFL2=7J zNZVgP8wZ6B<}D43|Gn41Y$MD=$2%~Y>=ukgi5X5Di}x9rorJj>FlPOKBWTj=fB|ZP zi!BWyamev@xcV1F(M9tP?aBeKn7ld%EVwWyur!`VAn z5ycT7p{5w4!Eg+840m^!^?{ijB#Hjps~n>96{RGa5$BrdVp2LV12h*fH7~+!9-8?m zG}q5HLnhR8ky!@FPo#SpcD{PHP$v!>mzz#xU)_SdX4nXoqK=?~+)OP^U1o71FsFH> z6~^&YP-Cq(xhRO+YV{JJ#Y2f^aE&SKK;TR?WDzr&dxNhub{kkZCgx&x8p^ zsV(D>kWqfN(;*|0#^Hko?G&Ot9B9q>NNi&_XB~6q=Sxo)7QKNXftKYG8d^{;6X4Y~ zgH(K-+~!qmRcEPz=0udH|E!2o86h?l9dKBGunqc%%vPq7Tz4u*QjZX30JoLm$8g&M z$spV|j0=OV+QAVr5A{(agmsJ!!}drHhQLcZL=U-Vms&%Q%|XIhL7N#gLNw8pic%6i zS|w$zoRrE4sbFeegxNeaGpo>iev5|<-4SwcBHeexx9b@piE_~Gy@l+(iO8$#*uA-i zN5!MUt)x~C?~?1gg!Z!A)Hsm?yf{MS*e+Qlmt(ue-R2=}@_(HX;-Y(s=)T7anVwI! z8g=(mqwc1m6P)>kY4UMBxYnMDiGzI1hc-e+`Pn`d!!n7FA2NKrkqFOY{eGeFP_sBT z2E&#MWn3H^pQL?^myY@hhtznOi#n}K*vBO7D?|xU`=~|)L97)2>_*{;0vAscC(cQU z3I`4mhln~&qhx&NLyC)Clrf^54wQsUTtL-2f}8hC<{d8NVP$Oh3nmwPnexJKoSt_J z{Eh{7LV>#HbFi+dG>KeEQG!hZ$2mREG<$v>e(l+?4%qX2Xd`5lpY2l26-hl$wO(lw zJrVRC8%KoF^S{8d=m<(0EQ{8n^=ox6Oik$dF}(H+-SA)d`E<{Rnua2zMsm!VYc}3D}I#y84i_Cx+ftcWrAk;UTc}`$kARh(mK#f&)R=oaiKh_h7^#)+|FhHVU za49Ti-YVpEBWE0AC2(nUg3EcKrn-PCpUwi)P@raj$r!te0cs^h2AG3E?Jxk-WPoMt z=~+e{`?RMKXaCmdgQ+ z(k-9EA!nFjAEP$7gkDZUKg-)KGjK^1X!)bj^7t?IrDM4+myd$ASYs7tn2(5Z#ey!@ zDa1M%SUt>;ILEtrr!j9C@)|t~DpUu{r!`(qJlCv~y9G9~z^}P;SlJcjh8ZdhGt7Xz zbeMr@GD9O3muV3AWClL85i-ip_Q|q9l)wzM?3FaQp9rf^gI`PR-l z^@=xWg0F-bHa2*e;TxkaxrF|QgmQsvH_WgGC4w3FqtUKIGEp+{qhLK)V-;qY9)R^n zVyy;N4>Kf62A9Il*ku?y4te)bG7Ru?VjmMe%jwQlVP=jAwGQ6dFg+IDiHmhE7nPGu! zEt76pIn%=o`y)_F32c|pQ%UFx*dM$bX4tCG@<*fn6iF{LEQs)JAjv>k)-77ngM5DUQuv~U; zNw+M$(ZdYy8EwiX^hOf;M9yxRVV6S7AC2}0h1N_H%Om_KSkp9CVTK6-SZ5P!e_-`6 zL!xAGDQschF!Ju9WH{2xiHAtY73V0o!1*lj1^naa3~-VuW~h)9nPC;Q0f!lwCNtzy zG7QFiKxW`WTRHMa`Pu#n9GGN5EHTXRBoX#P4SsRSkO3TE2L9+?$wV@N85TtNO1kAQ zH+Y!g+s~Xa>Jqw&g#HOqdpDAS3nf6yAB{F!p*75~Kt2lAuj>_7VTOhPtm}yNL}2wW zL!xAGDSU%@J0tHNN`?cxoOsN?{8j#d1wH|rQZqvd`c*MQe@T%U7GvN$%)m66VIjKS zF2Q_2X5d2`A*1|ke+3RqVuqz?AEiL3jKfBJu3}*#k-IrL809Fq(BuWOC z!ULIiC)R5BP%?Da{4bo?=~IUp+yakafqz1Qni(F(&{oW_NK#~m{zy5@z%-em5gLMh zJmv#310UK58RcjDQ*dAsGb}^;WOk##Mw2xwjn}~2H5&qJCh6>dy{L#Hqsd~j_hUK#JO1kAH1~DpM zcBttgqfNPl-bq5Ihj+^iqZL~IXtZM#TEh&>Ws{d+UB?JNhZzb3u>OHqGlA8^42hD# zrLdKG-w*AvWcbp{iU0b@VFtIrMJ&)lftnd+$Z84KO&TRdW+;an!C?lb$qW_L6!*PJ zF#{jk2pQ#P`&CHbBxYES_EF5Rnh0Y=_)B>m9Y4ba)hqnby%JTu;xfYm*N(Pt0 z&zN@u^6sI|@DDF1ejR}PD;78%1!`v4ihfm+;ZsSG86HMAJIuf|nPD?UK*kKk418!K zWR#!n=OBTTnBjS}hGK>+ST3>miSU<}4E4YPdCec)D>IP92y>ZXd4#W|TcT4u%y5g* zrd&dMk^_-Tps=>e=Qm{%;T|WWWkbniEIKWr@(H*>5CArZ3 zK9UJ6wmibG(!9{09u~VOfPhy?Kwl8R0Mj znB|F5C3fwIpW;m`rs;)Zj#pJ|n7Ma>0-Q`MyW6p`UJ}@d0l-3>%^h&Lx3SjijkUfF zoa?YQ(`4-ePO&#b$s=p?p=~Oyb$+%7VfZDn_N#`f6G_#tK~;+I6*uQe%z0TCVUt4V zL{TSnr6ehI<$pckrCGV(xUKRV&rAH0R!gpgTQgl8=?zGRZ^B zco6EglH%A)SnjnbH+l>9OJFpJcn+uQ^DUjTf;bN;fEfhn3F0~2aYKt7<&4|J86}?O z9?Fz2hceAVS0k{z|3-5t(`pckvbdSVIh-j!=y0a|_JG5g^4kLrXX246#V}4S&*4ld zk5oy6s-dQl3`ubs$%YQ%j5Ve?)>d$=alYVK<3k%Eqx@`df>=%(Yg+$* zR%h3rgXZ6;;=7#tOb%v_?*ZV~W&STm3*Mtf6^|d8K=ewPnWT~&S(8aq##=cYVK$FRP=_PT z&V`&BcbSKd$**(1Vn|&Lu&7Z;u5ou5`nG8VZ-&PB_sg~5uE1tY?BEUFHr@YXciZ$* zcCy~UqMPClHih0cy&CO_9g;r!RCVq))%iG~I?lG~dEADzs!EDbr*fy-Rh)9$bU`YJ z6#I~IxOXaulzW|1?7;3|OY>atoAt8Z(!8QSw=|P+SN?H9dU!GZ?zulbyt*|#{GWyC z;R7E|5AXX(dU(G@>EXj3OAi+;P7n8eB0W50NqTt1()957W$EGHwxx%!Tb>@C{d{_O z-Uj4x@9~$jHa*-Me`nyY27k`}+yZ9{8|cOU+@$@^U8nH= zxlAi~zw`CzHr17H!%4XZ`h zok|93I9C|RW&VKu&iUB8T+$D$Z1y|fFsg(7&c)7t=L`+w+3%ciOWyAHJOAk_X<*EV zd$`~E(~&=Kzw@=GWm?&gyV>td50vWBVa#pzJOA{X?W;ONZ+3R}UwZaC&)oJf1hT`tDsE^*(Tbui+v(*VwidLuVco<2d5oT=!NU=5RIf zMx^#VAD#|;O2~7O3w($ zjZfAaI*}dZ<{{|aw=>WMy`G>4(!0SKr!;dOGgYsU)b zscMIs@{LmSAp0*3kA9^lpx<4VTST~pnbJJwOl1bR&t&&NIhSA2XAsxUICl&^_h@D5 zBAB*9GA^mcrs&$+a*KA#>1-UNdGtcn4>Tq{S8kd%UhN za1Zt{lQoN3N6-}@!we%-wrnSQ?9VmX4`B8PvM28m)-+U@oO#Uo9qe^Lvj<^Vo09-FEER0h`L&3BoDw5$cG+i*iT zE!21cst~WsMe`;$!f;cykwj8OKTBO6vT2dzqiTc!7)yW&pekM$0f1Ud^Rv%L0}v%Z z7XX-M*3Ks%k}3mpHDMOg&A|qLvnq+}dt}3+_by}h|INur|#&$hUHk5Oj-@)wSZl^lm zRPS}7d!NMo4Jwjg=H<(`E3pYBRbQ)0|D0iMDj zXN%!HPMk8cUC&AR)|4z^ctjq0@+t=y-;!x{Q>Ma6_4gBwbt5$&Qsl)iK$+nr$^$7{vY<l>{wNWdUL zK!YGQlR-^lRo6UqGlWS41PFtQhLAKQkco7MNko)EFsP^qsHmVgAqpxgASxm%C@Lxf z&ZwwCKv7W;QSNV_s_w1~=yTuo-0zS3y}i~+x=x*8pS}0llR1J zd7&{0nvI|f^{)A|YcK5XD@S`!YjUQ6$j0+0CqZgMy3J4jqT(9dG`$PnQv{wW2RHpTJkCum9gt=KB=PqHC%}00n4Y#tsJ{9V7ZRKv zs=Ud8WG;i`VA#Vvu9!Z{X|RAA96mUNMIL83?-1!iYKrm8Q|w1@#3fJBQ)3ywJQd@Y zr&6j%#+euIKLQZWsP|!1hn0y=o-hdBUZ3RU5%JU01VZWyKgHjI?)im3qUpbSTxd-Nxs>Y-PsWT!$`|%!XtQM1tfbt4|aRKY5{Z8 z+$hM#ODGCL#_Vfj7moX|L2?+S{~o817wDQQu@{oozQ+4W*%R81>VKWOWo{!ZGrPK* z%A9NV&fDnyU7q`ip8K;7`S9x7s-MNfBdSh7ulmTR!H95c(y~uA!9V&jZVF0kSc<;t zWhRYHO7wzLZL(lBIvm*)6FXe`3%s%epTN3Up@EF^?z)I2H)1#XNs%Vi8z7z! zHm<(WpbQmWXv;<$Jb1%N0o-8)09i3!9u5JLjX!Bs?_>jLsX9E2*arH0s>rq?8u{>+ z%=Qc-2PtR8kdg_g@E)vW3XC4O24Z!^YCu@E7yFD}1qtNTHD|Ke zjm`|GG}0xdy1%n$4i?up=V?QVME=v>OvcUnAMS`7$@KD2@q;(#jsiaDW1hbV6vZoy z#O>z!^hkF+6<*wIvR7Z?6&7c1JM*o|q@kzUM9_*f)Xq5{L=%TCVglpd%+R;9&k zdP(%DCRMjuxLIdS^IxXw81Io06X(4Y@ZKsAvTBgSdrP4mt9sPoJ=n*H-Qcwa7%47y z9U`}mLG-YP^+4Ee&QTBAQ$Rxd>Q3Ns@YhvQ;nSLg&*v0L!y9givmEw%o7gL@x;65p zjJ;aSzYQom9gDSz&A!cHu@taaYa%ls;H$66VX_V1>z7lf(-Sb!U}i7@-L|#?l1K)~ zX4w1iAa5n#w+_nL-T8Cr9%ineCvoGnTwFh_Y*APolqhlWEQX-OgN3I70uw;`5Dce_ zY}e1Q=vP0RyOOu+*6e!MOpeCz`E%(e#Ao5c&JB{Y-<(Tc7k%EGJJS7DeK92QflORM z;F*m_LnKyC7;&o2bcfmF-iZ%Q9GP}Cf^r9Lq8{*0>SFt|G5#jLb`8f%W3VRSNZ^4_F_ZHE*_Q?~2CSp| zoxKz9mQ39!yz?*n_?EuOrzR(6GnJR1kt#}x(S>kY7dy-WWKZFXHSG5f4e6fqjzwk| zs}7)2Y< z9*%FYWvhKmx{wNVEwhc#{RfBP+y^^{QnlN8OeLPziC+n#w*9Obi3zvNNQ{g*rLHK% zbcGe*w($vt-7S3IiwO#|@a+`BO6#E&W^HZn@c-)=mf_qX#u-2%)3SpL>Fb95q^B1t z4)V91qDilKt!ff`_I4bGR)B%x={>>Kn=yJsFxg9$BNv@2PjaA{M-VK;pEv}rRdGEn ztW9;<6X5)9bGBCs4q!70u%wnzBM8=}3)uLU8&(rkf6ELiar0|+SfREdN5&pL5Z{R) zW}^c`5u(KPtV2n7s^S59pdy|Tgb)Xwd$(ez+{kRB0vgvGt_I+w`TQHyr5*pX|S2ONxCkDFD^2_@dw zD-tAF6otp|d?->VUgyA|3P|g!FRFULjm94Y?Wzvod42$+_541`2;d=Xj61y(=i@b2 zz45>h{F&d!cZxkSv#JdbW2(9VOL&oGS_c!bMqNzYN0?|z6E-Koz=Ay~=Bq7c--RaQ z6WmaMyQVthAn56ivyR4jmDwG`ht8h?tZoBOQBW@tFNyevjvJ_B7#-_~M1(fJBrfrL zk#n#MUUfSlrNv#Fv91(-K%(>QEPX(G_N~S2bFl^71IdZl%ub9ciG8CO(=Oyu&(gKR^c|$2a^JoW=Vz zqCWWqZtq6uM*l$L6+1vYIKzFSFY;v@V}2i`gV@>2SUi)M%ER69aa+*1XJXv>*U?LL zPc@u>b?XBZxOdT#9SgnX#6oW)F{z7|bow4c%cvn9v{27Nx?SBSi#D>8$f|=DgyUVb z@C3>#Tmso(FRXG;R8zX40Y6%Zrw+=*@Z%eR)W8Ft+T+Co7H~~#baW%clboGpqoYUG z(3}h#r!nE`J@fE8Jkr`;cvOWIlDrxyIP&W7!9=_gyy~aIq)hjt9rL)UEICpshiu{WglC zkp~AtTMZ{62c4BfiKrQ^Pss&jZnas*G>@YyF2jbb&BJlHWz3D(o+mOF-L8#@Di5T) zSR|Y0wK`k-RFgX9WYwFjX_Wij=Q}@I>v`&@xG4JT#Gi&EOjPwVtn`72bxazl>!kTJ z604>oUc{7lGNihr!&_62x;Y!t>@a5NX5B>c{2A@(!Td2$7|^p0r9}@vP-F)ugjfSe*)v;H`v#ZALVgLk>*$T2*| z_Zo83rK-~Q=*Cy|p+G@eRUe8Icf$+o@Q-3i$yEa>H0C?l2!hR*O#``hHE|Rgq|7?r zxW!FtnD!xy8s{sLj^lg8qwy&1t|v2QL|)F#e43XV9d$ z4hd0;ha&R~)+j#MW*V%(J6IMC7K#pL!ET8T22qeiWQ5jgLewB^HI5IpgNADB9cl;- zb)GvE@(Q=!1FRPAMLTkKx@}C(Vb0FG)nZ>l3^_aQsm|flb01p6A(JRX2u}7L90MQc zjEII~!H!SS4-U=vGaL_RKSr(J!=-GK2HFRPXNw zS45^aMW9*otmCID&px#q^l+IV9|IojgO=T@H=-pmTb(uq)TR^Kq*X6=+JJdaRSsn1 zWI9$y2yHyVuOF7ngx}!t{WcsSWVXMEiJ)1I-$fJROxga{RGIb~Q2qm4g}0=de?l^6(av?AGPfqRW*(hp6uZIYuu`>3J8w+ z6iqz`TK~zon@6OYn94{+GL=lUl-K5uOqxF>d44$~164r69(XaX3rOHrpXvMSRJQlc z-E~YFcr>p0dmC0Tczm-BqiMPZ(dlXk@ah*Y_#ck<%!MxaHO3n{qUsNEdsW}$s@%l) zkDGg2Jb+NLo}1j_fz5NaMOvL|P}MhSe(R;T^h%iDHxWy}>a`&Vwk3lFpnq{Sc*v70M=*ohbWJj-w=XZOC1SBB5lWj6x|! znSrthWfjUslx-+`QGP^8ys#nH9z{XPM9D!ZK$(tmGs<$5wJ2|)>_w?YIgZjgwISCH zML`*YG6p4rawFhag#YVNcAdj^g+>3E<`yS zr2)!!ok1s*O(>6`EJB%vQh?G2#gCGL(g5WLBqnyDY(ZI#vJj;hB^$*;$v|n3l7w=! zBWQ@S6=fC5VwAZk6(~6<-BE4?UefTNK6_IVa1Q97KYWHi!;dCo%PLC?eEEfW6?yrQ zP=zm2m>2Qo=arV0MSS5%UPZ*0S31=fDVq=~=zL9>TZS1GQPcvs6fz%$$2vrp2*Fa8fI+tRP&*8`* z2f1-zqcSK?vs%N~q)!ac!qAk0P<~MfaOLh>2acjr$Vo`9VWma+Wd))5L@rq&hYLb= z*GGp! z;<_LNT?HBt=NIOc78FC;IIzd@SV{}Ur{ihIrxuQ0Dg~d{?(eXgGfM4yW1-ui<=6!E z!=9R+T8D??usLJrmlYS2LMkgIIO`vWH0|kNb2aH{`=+L)l0Zzo+C$qo3~UWi_5H77 zTzC30;$Uzcfo#ykn3`8ooKaRWF3r#Lej~aE3M$KsX_tq5wN+D;ccER&ArQvE#Bh|C zyBz_Z%X^+NYN`_M^mjNewryaU6f)5|mQ1IiIYWB)7?9q3AjR%uZQRxnr}dl?Ckyn`$jJ@Z;!10J%*wyR~jmU)`G!@ zJyMDrWVsdP!+025oHx#~yuz?TipCa&3aI_XC>Nr1v^b77C5ihOHEI(K_v3rdS5g^{ zFr#k_v}8$ngjlxDeaAMP44`~W8P@JkVl#fXZhtZ$NfdSb?f35mt5k=hRGvQ=sURsxsE%)RYu093raevB`!C&eCm{3aDODkRhAdfKQ0>< zUZ|osqtWD|f=D6SjSEF`T`L={DUx(HMIhvyNpMX9HF}ZHfGsM`1#$C3WAgGRaNJO4uVB<1<~nlaWkvAVD!4R+ z)GU;6WGY(^p`(Pkm=GfvHykP+n?Y(NRFLb;?>eIp2Ea3xMAi}vx;$U@)JP$Wy|OXm z$%-Uzw7e*P0$GR{hs0`BM&S~83x^^MZMpfZUv6%ly^Sg0lRC&6%Iq-*_+Acz8BJ&` z&))HN;b`x8=E@~nX^w~2wIB`aD6T9i^>rmdnVVYzF$7@nVdLWen98wZ zfhynvD<;c19~?_=F>6osuLy-Jiy5tI%RMhZ6wu5I=R*`yhq7WIk8|dxc`HH%mHDAK zHaL!sBIM@6bdEUi_=ryMejuZ!LG*)p$rUdv55ZVMQ*H z5q+qD7O8bfW|;a^j0jEeG-9xa7F_xDIkW`<27WY7&jX3~nx~V3c8FV(~64k&3Af zpJqlQ63!*p91Jkjji>-*mkL-jd8BTeD4fn-bKuO)Ee%Zu3pjh2QP6D-*-+4x7qL=T zws0XPb>ecw+d3K-@!-*Wo9n^6W@qSZck8;oP9=79Nr)l{VaV(JLSG*KlV}Jza>&uO zV0Or5hJS<~Drl);5)VxAch9Sgl;tv!5bBmwQ5m|3=;Lhfa9L%A6H~zcVe&1CC&pZ8 zSKBvWdYaLJ_FsNsD1Sn@68;#I;iw-FDk-a&>M$(vIq?9aPjq0<${iU#32tU_h<2KD z?clz&%;&I>s~0Llus*_&!x)h87#+^Tg4olgSQb!*T>@5yD5RKP9$BZ@wo$i-=0PyU z-P@!s%NVDUye|k%!5XYFQ=yL>43W*|;+pJ6hGSH5R;B9-#+z|)=x9H4z2b1VJD27J zXNO5$IWmQ8i(alWq49>q*B9%xBleyLgKN+uv)~M%g0l>(({wn-uo( zQ^c`(k~~K7*}iU$SdWVTG$;n3-BAl^EQXlobG76}7jdyQK&=7Q@cq%AOfjs67#&-k z$(zeV?&b$BqI4qjpaR;#=?7g1=@W%_C>x70V@w`6b#V#d+8bj?-#GFVW8{sC$pBY& z)fmLVr(^4b9m>EZd1PzEWgbDES4?|jsz--F)*yQ7@J387ho-QKntk(&!LMx1)>y=$ z!Jwr3n6uzjdV~kETd=EfpV_dvx%tI;;V>JsqzK*%+PDgl*)h0eeiD<5E>@!Z%)3b1 zf4yPqMKO-O8Wl$&R}6A2P@U^;5{w(wgWmn>-N$Tv7qd*~x!+y;zRvQPOz{%HZ6C8w z!8ovh;POWIJ@|%&>7(30t93p*Zf$i9eIvbZ;h;t9cF4t?*^u2F#s2=!{xpK!kld~z zd)ikqGW#_~!4U=eoQd*&J;vc0 z;eQ6t=Z}SfS026YH6*9Y$X-3DO{8Ysl~gySMqPi_ZhFl+)^28vx@^{NcFj80ZeESL z9M*0@%{ta@A?jwP0Nx5(1IGa$4*cx8OL&S?&2Ub*ciMHCHf>tL7_wip&yTi`bjXI~@Xw=QbxEXBXE+k61eW+tGiI4+~)B$-kYUAMDPiW>kbL^1JW?4Ko^bOXGD6E~@u_knKN3*E`++(d#qLa&lqO>s__(-|!Fj zhqp*bu0)}6qy6`K`d73{NS=d2_v!PNyPwVmeiCpUEs3~JLPPeoY?tQi&p2x638eJV>?NZc8O%cN0;=7vkl z(Izq$nW{NhAW;6+pZz%Fkx;c+0TfAV_F)Ht$aT2^>@5Q=ih*`g397h z7VM&87jW(c7lwgl70CKv&=~aeTZlMb33QhG;nur7207sfSYjKaa51z;A-mbrI};I% zf)E0N8WaI=KaeGbbBBZ|=)ruX{5W0vBCdc`D`>#T+lgpH0i~V@DCPD;5{~0!qK%he z!{9=KP@w{%TxS<2Ln=!nMI}*__r~}PF6Tr!pO6VaUzHUevC0y|4fcMjP($M4R;dcTw#3F=#shj81D@% zD-8igICON}2Mb1~!{LMt=o7U}bK!1L2s_L@2+Cwq)CTM89|^^Fz(cWm(3cwl*c_f> z8;Uzl^aKahj(~jN(iwxfh$^lDDQ3Xl`_yekOxK5a2(W%bbqHeR(w|-+JeXT{apjHY zJYHvqO$zmb;mmOlU<9_3fv^U-weB3z@vn=+F{CKJkX$iDaLLSw;>cOq1~z`5yy9>a zjV;mB<-Pu;*~MV09t8zl0&1PDLE9|4GkyZZ140Nb7C1s<3$EENW`n=%!ZZY)bQvaZ z@2+nU0wQC{KVXi)EY!L?5VUpXpmlNF2^yVkN8$yi?kRW7*cOZm5N=Hr10jlBJrRYZ zN0@Qz)Hpr{mSOCNfQP6&q%9f6+k@1v2%bL)6Rt828<60@f*cXy5P}wa6Al{u?D*I& zcSd*3Y8R$nNCQ-G_eRI=QI5D^0jJ<@PlOS|uEd=YAIC$po@HgA_7o4ij-=qY5$I2> zog=rODidozLHM40AdaP8d%9Cv@ThOK+6XEujV2FGC|_Ultr$|PY0 z;Vv^oo?Je6O(RGgHZ0IUn=AKnI{m}sKnL`XaTN=pT~Hp;#(7k=zQF~9+WOLoWaPoWcM0VG61`jkAizROD4aMidu^x%`H-SDaMF zP!fjyAm_O20c~bzOy#(7p^7M!m-ikruy+>xF@~|rD2kR}2u$|n5Rfh@n-t>u(6{_@ zNXdTmEllT{x+2mUjuhlZhl?l#VWO zkmzh4w*^d-DR59(?3$u|NF$BI0x^$!XRK>+b6se~FrZ;p*XVQsU_l-OOoM^Ab8*GK za2EmUNCh%ETwZxmdP$hP;&il3FAU|Crxy$9Lb{8eTKCZlX74|>sBjFz8cphRa{oW9 zd%Eo_nFGJ;{vyH$EKU)P4MeAm$GP(n$E_Ljb`}`VS&TbfZa1U8J2i5_Zq&ik4glmb z0!L%8#18+3?<~4O;q{Ez@J__Tt;3>d7Ec|EhodzChdVXyQHD8o%hSh6XU6W-=o1Sk z#}d96GeWjB{`ZcaneCb(DB(2UIAk`vX5fGkB2%96J?Y%|D6s_*j9%QaHM`m3__E#c z{_FKlo+vlOEKUdJ=o}S!NMa%kA6-kd-l-&hB3ra(pWFy#>hU+XjQQQQ?-N;AlUn`C zL!k-o4d8>hWA(Q4-l;t{!ONCYYizd?I=B&Br>h3=` zyBObq?mYim?#Ojv~4WiRnNU# zCm&P;@6mq1n|ns1CXHkF>mWYPukkjpV!|v27MF81`Kqikg8XBQ2s8#ei&Qh0`d_bO zGPS-@|KG^+`unF+poQ#m9Bg$C5xGZP!j)sf`4vUwu9frumv-(Vakh@ERG(*Ag*aY; zY$guhb;BtM&y9b?i?grl!7bC8l!d0#X^#C7E-gZU0Q;jJW~@)iM$e8gqX1)&0YGC# z&o4#KNJY<;Ij}gV0Sb!3Bt*Hm7Ia{6v=@9LkH+$9rMMPy+DGNSS6g^Bf>#5?CBC~} zmV|Zp>wmcB8uAcpjjkg^f(0KYOb7>*3CI7~zQ_0f6t6X9p)2Fi-xIZ@lar<6kU&NV zll^up-TBQ`2@6}%kHgs6SRb#tAzGL&1Rp2K{WVb+_18R8Hsb?EnHbn zC$G>3*= z$iA19;cI9LexHW}$+RfPPVIJ)FOoMQ6o%QV;m@=JoE{0olPg0M3nyF0v0t9Rx~0P? zxH*ne6c=$_!{|rGZV3($7SXTo5UZtM!oek{AJI)NtH9AAw>JaOGoO1u96NPE8lsdP zpo)zP?(m$qJ0p5o z?DL{<$RMbFVhprAU+gq09iS&sPxu5|L@4s$bG&h23&&5VvV)Cv{K?K7Fz+oxC`t$#1}4Pzl~(mAU#l7LBBa+zbkS zg2*cwLNItH&#MfBUhHHDQYiET#IXnm)tdO<@EhZy{~}FOok9Oan-Wgg&r8Q*XT-WN z5#s*HYDzlgl9*TtAu#h_3nSgWE%DXxFAgFIw$^t z$7tk1AVey;s}x>^!r(tsod-AVHM*y2Xy@U^_Zz5z)RhgjsQP zFa#Nk<a)9VM6ypplW$QtYs1TbLik*jMo4YHMhh5p(G@~m) zz$S7Iq+{;@f-)RUW=E{)Yc!w7=#`2e1-rLOLpVE6To>&gYZc6wREcUbz_#1!^ez9>vECJvFLo&Ya=%<={7> zd1LT{#|ZuW+6A??xPY``zC6yz#w8Gq2BlKqW`;vJagHCgF);^~jo<1bhRJ?Oo#z`{ zN%7ejj98U(s6GSd{=i5P+I}@p97+bxbEV+@WWYatEL6xY2+{OnCN9_q8QZNp?d zUC#L=ByjYe=>@H8*3pZBTeoSLjH61ic8kz=X)8Rw*;6+Kb=y#PmZxqu>T)n%?7$D^ zn2jd@^*gU&^0}UN>qj?CK8iU~JavumaG#`e8zwjP)Jf>O3C~rDtrg=XqHY`7dFS1S zb?iTI*h`8b}-vNXA7yB&b#IPl`_I~sLI&Tg38$}`?{z_$n2#5&q|>Wa}W zsTTeU0LxzBU}UTv$7KPQktsFtHyf}d*P=%;@Rtc#y!1^&-yP_Cc5J)^u07@$i8&g3 z>bd}yeYJRlUN$ibIPi{_f;rOA*IPFleSPT5j0_qRj7l#N+XXy(+ZBRtDd_8^$7i71 z=vw1#0?d!0&dbmAHqy1=7w>rVYLz6c*Gr@Qm}3g?;+owz<)cjULNc9;$<(^)&)G|tt$t7OR=^neQ6F0c-aY&O2T|@K7OSju*bIfX`b;<81>hE72|vA7~Ew;;o~03o-AZ zT0D6KIGB#LdHL!P>OKQ4y?bjVa4@eHeAR$?A?Ee!g=)+(3U%Inz6lZ@V#d{xu@HD!23mUCbp!tPVqSXmF#BK+&LjF_y-;L5c95u?2PL&j$4QEymi#BAKLkVD=*z7j8|TZ z54vIA z<8h!HJ(6)5=JnEY8DLor_~J5~*$Vl z-GGC*euKQnc-}f{w-WTot_AZUz+8upqP&&)=<Xk*%tW1+M%@8l`&xM3 zhq_2DzDfps^J>_2;Bnw88RL2P7Ke5btRrf3(f-xIry~J#dk@UJ0H3#xVBQRR1A2vsw~pFnqi!kYi0f&NI|O=o>!{sc)ExmmyzNrZ*IP&JW&#H} z*q2_ImtnoDLASVl0DlJj;;o~;8rEx}ueV)ytj$|T?Rd1y#-5JSm+IQ1t_x@xtt0xb z11vj$tGI8hYy;u(B>(?uOO>Mn>x}fc7w_@|ccr2jynE!g6>Ff$0jd5Guarm5?Fw`C| z`2f937Ie9zZr|E%qt~SCNFS44CA*MpSEeJ}2E{t|@K^CTO9a;(-l-PdzcXwQZa#QczzxK3UizrPmOn@i%?o9MphdK<2N#qs{TaGgCq-hLmh7Z$~@ z58?VqVf^|eu9LgPuaiNmnW+upGChh2_x~;h{g)@i;LYN(oy?4vAVkzI~V-t zIIlG&ew^uGlgAjzRdvVN*7Kj~KC`_;_wKjW?OSIqw}Q@p(T8L?Re9Gn8aVU0?e;DD z&&M47s{@DIHMXvW7$do!ags+kbCG@?k_@mszA3n@awiDS!G(M01 zT&=Zhs9Sqy%{6sL-RN3%{ZN-&t1g?yt5r7=bw~cgJx@P~?2B?43fVs~8ISM(`}w~O z0|^|(H&ABQTzLXV@f*IL`li?@{cw+d3wwLbPVCAGPANfN%lU1QohoGTsd$L0^PC?$ zl|7Ov)kk^8f;^;HLU!uZP&hRhXx_|1t_u&^!1FUOKxx=cMPAYf<7h)kUO2s^D8HgC zTsAh6jy#Bw7cR+|B%~sfP+Bw=r<>hhGC8x+P?tu>!bLqW{$E`Msgwx>Wb$qOKl@Mm zKM}8#j>)ep)3jOI9_?$bi7x4yZt30iOue6;rH|Hc*Pqw(jC+j7jf>5`_I!FEhtJ^w zfuGIa#ec;Q6mAth6>|N8I9{A8c9tZmLK-VimYXTi)Q`#Z2lc{kNJn$(CTVkY7Mro zvMTNC?W90*pmiW6&_3V`bP03|qy_kZ6wm@zpnD)Q&@Ye`$PVNLMg~UFddnR+U(?^w zztj)tOUy^iYwX7ZF9yC1($104WHNsPznbqS4iSedMM|mC(i~)swDPP8m~Dprusthq zOCS{dEqF4B#tWVCeig>~(`8kDQ<j`F6Ql;WbIqG)wEQWorGjEG=8h(MD>cw9#6D zR;U$gAICT0&*C-yd;UDZ7A6Zx{s;Yg z{DtBz;%2djv`!i!SIfrVT1`<=kvz-NJdf&GE%z@fmAz|p|*z{vm?Y!plkCIyp&t%E7S_5{m5 z2mWXHlYEwNK&VuvE05@(>HGBkdbNH?KcXMik7LE0(a1 zei%QB&*#VU75p^*M*dcQ3BQbg5WMs}{|3LC|BnBO&%yra=U?Jq<$uY)-T$%w2Y<5I zRZJ88Vx~AyTrF-8_lebFf@Dg=r7_Y(X_|DC^t|-4^r7^nbWr+PIwm!go62eO)pDYe zst8I?Wss7iOjE8`Rw_>`?<(z7pDL<7)KTg<^(XbX%4vPI;o8;Oo!T<(ac!OUlD1R( z46>nG`%ycpozOV_3_VFdTTcOYy66|{yq>RD>eKZb_4)c@eJ}RN8OGU0H>01CWn>#U z#!BN!V}r59c++^#_!Yd?z&zV*Yj!mInnTR1&57oX=AGtJ^L}%s`JwrXsak!l94prf zS&v#zTRSYjz0)2Om>bv#%BKbSpcK@CRhS3-}KCAMwBG-{=3%f5gv;y~V4O6Ik`ndYC`i8nkJ*Xa28)?Z}CoNsmwSd+K_&=$&&^zlR^$Ge^{RaIO z{Z9Q}{Vm}8Tm5&vq0!W6W%v!l=nK3*Z@gr@ZtORX8NINZwwoWAd(D03&*pKHvszjP zq|#mX=l0k34|bElIf21}YXe^d`UkHLP7F>8UK^YRtiBlhiS`4Zz-`69%OUBX;9uka z1kPFt=L(k!`9iTUQJ5<15xx?B5RM5A{7w8V{E}by_wbMM7y3W)fA0U$-&G8V)5S&N zPVu-nS{f^rLSE02Zjt_y+RB~eZt_NXtK3v+tBA@-fwO3)NNX7wY%wA@!)5137k%QHg!{45ZSh#t)EOXPK?d_U1ryk~!V%ZY{AJ1X=|? zhO`I;-v@7S-4nRSV9+G+&H1zW^LPO~5dcSwo>GlbdDam$3qg*Czp!e-%h;cej~;alOL@GJNw0V{9m@90nUU+UNV zHn?Yie>5-<_D}cU;J?X#yMH-&=?VV}{>}c^{ci&^-}-;@ANT*|Zzwhw+l!qc$1fF4 zvAftu%ofLq#bO0;Rt2oxBQ6&o5uXuX5ML7C6nBeXiQkEb#NWk6(wS0{Qi+oZ(LpfVH5Aq=m5+YOS4;gWVQm9<3%uyaz)+<|-ZJRHr>l+|%-`02P-#~Kz2&vt~IM3)}WEvxk zJmW^_izUVi<5lAgW2f8Z(E0~U#tZCO#2d>w+%bf&bCL| zA$z=CX5VPvWZz;hu^+KF*ss~&*uUFcpkp94pg`V_4uk?_fvJHx(DL^L9tf-qyb#zF z*b>+g_%!e%v{g#*lAs(M9vl^%5UdQ|6}%_7GWb+*V{l9Gz2L6k$BU{#&3+Uhu!=-{t?!|EIs1*jkiC zUF;22vF*el1R1i7Ou$pJZ64#^RD2KekD`APW&aN67QUiowRYxy_%gv=?;uRaS%QK=9fGwMxBTeN5f1z6W_w zttM*CwR5$O;51q539Xf-<-*z-4+${~ytZ813?2Tt_P5qZZ>66PP2Lk0?Qn3~czrVT z)eZV0{cimM{c(Lgce|X z*37)vw4uQY%~JC^^Ct6AbG7+AESDYTF7qq%JM*CVH!RMkRx7I$cr6HhR$)!I?z0}U zp0PGrpIKj72d&@0X-(~O>~^*f)`VsU?0)tL@LI%PWIt*@ZGT|zwZFH2wp&6%`vMn( z(*l9ZVV4dI6b4EH;lOo)1>m*E1KVL8eHUmFYz`~v!eF1^<-uXWTyR=AI5RjWcysW+ z;Df=(g3knB1+RS({5!~vcKEC%-;THVo{)rB@z?S*`J161NfJKCZ{%NrB;3P)4twr* zzNyek5QRQMHst+eVXm-HSSvgyydrD|r+p6D|C4Z3XyQ-upY3n&zXZJ253=uC{~XA? z)&3VD@xFz{a@7AfIPGll0%k9GGDn9dggIx;Fp!xlx@nV%0A^g<%n`hIa_TH zJv>OgLY)RL(hbptfTNqwAWyX{-FN>UELY>k>9YuY1zir z#u#IqG0nK%m}A^#+z(!R5qj-MSW0cp3(O2tGe^Qs8V5`1I&+SBhq=UDX09>UnH!lW({Ynk;3IBlc#CM>A;t^L*k>nH0ED-pcb)$R?MHpZT1 z&$pM_587MoH|_WBPr+$F*(dFUz!`zIfe!GAG6FVu?aIJ3$h0Ma^?{cI?*#S)j=}Oi z12%X2V3(i}RDx!3U~p*gieP@Q0=#xxa1CVIj^N?ouVg#G;9U)Q)__mq)1Y-tzBhR7 z3VtjSuf68q3GMoc|FHiT=+_2fOK@8TY~(y~ zg1A7uLtG&~A-)Y;geAmCn;4*msF__xGi6r1*x`NdR2N8cHKVMbdBW} z(4bxAblH%Da;7{&9wm>Fi{)#fMVHF!A=N&Te~11&Q)#2fiUHj@5WF@qrWWS00bEkW-HKGPu8dO?3)4I6wSq}mPo{g7u*>Fe~D^>_7M z(4U848~&;L4A}@6y^PC^p~iK_LP)hIpgZ>&-@@}tV0u$Bby!b#nk&pL=3DTXe=$#* z4XiV*HrDyp#g^aFt$@`B9_={mVQZDO-g?>E2G07z`WBMxcZ;*nfYxkjp9}uF#Fin; zE(4ccV;9;J?d!m6q&shi_Pp0#0dM#TdyV}Z^yn+lq}%Ox><{fdutvWE4<3ZP`_2B- zK4mwD4R?Ov!hjes0=)x+AoZ>a6frG(W8l`nBIw!20#AW2Uj<)&8u%)35Pl&SJR{hQ zd4%T$JAgyG1v7&FV2@ySa71uSuoyf#C3q9OvZcZMgHHz62j2|t4DJqoNxV8Ufm;Ax zO@j}c39pPa@AdqA{tj^H3jSH}=o`?#AMs!E)%;P|hfReRLR;`_hF}Q2g#NG;M+t>O zM7U0vCEOw`79JFyf~EM9@TRa6JX#wqm-h$UWtO;Pk8IadJ5%>pVmlmdGpQRr2%l7I6Ig@~85C`3Shau|j;` zLAe;3JP0{E2zGpdQV!0)9Yn2VkE6R4|1LX^4KVs+dDwFi>j{n zQnL^rDo{(*uzH<3SG_}B0ehcp$=9Igcd4JN->3)FhFX$#w$>ifSAbnEauU2FGJX^POVHHjf%nsZZSR7aZZhaO$?CY=z_rTXW5J(7~ z8`R;&j)l*4C-`x5@NLM=!n zFj*Y}>;HOCt4h67U8*iu9|6U7tDmZ0!E;RnrDVjSdT9N%frurL53m6C{}OG5_OiAO z@js%_DeVmXOz6uL-KSrOD8g|4Dm@Rr?d|$f{XTdBtMq3;p)K$L4(q?_f9ai!OAOx7 zK%L%@W5bLIM!7M`m}x9Se1UwyEwIkMg~xjm5r!nQoynWBX_~#wGEnGRa~8aTXQ44A z%eH!2{j5T0%7-Aq_E|qz#}UtIZg+&_y3)>tyI2Y9tJHOf z1b(mns3vG#hYgmuU}bt6^jBg_Zq{b{O7V3heC8uzrT2p|= z;y!(?{yHq|PY{bE`=^<4j?oT#?Gi*QvW&sZtGgC7bm%tCoDE8CK@9L+L@my@Qb8%Q zp69}@xd&09)rbpig|GI$^{LgwZVT)ALU?OI*v{A31$HU)&5iZ~dogUARrU+^Ci_+U zBl}DHN4sI5X`ltH8#OQ~a6{m&z^*`7P;wsh!Q;VAuv@kTKM2ys+XPxB@LfU8GG-OO z!f%Jyb*|7J@;*%n3Yo${cw7arP-Y49AnhL&o))$U9}C~W>k9aLgM!OpjlAnW57x&G zt{1-wbovwaMt??`d!1z%xUKJ zpyd)4+k49V%=`fnsAFb=m27oGES~(Lf!0v#YSv~Xk3GCK&)@JKHSgb!<&0wi! z+xOXz+b7@y<-zBfjkxN4pxZZrQ-P+z-teeL!<&8p(Z63Q>bE(8TM61FBF@u_KcDZ1 z*#8LV@iM*=y8H=#En=#h5mWsM`|$*PXrktH;RaZl3!t$#A*%BhwDl*#p91GU!=H>7 z6Doeo-v`onBCO2mkiJVn+13765ySZr_N5Jb@__iO*bKV%B52xv(hyL0qV$yXEOhH@ z@P-e-Q~5(WSH6JxD*d5TN5Xb2l_$xwK;>KHg?wGCy^W~KkJ@of)BA&tlvUWH zf2aQh&BhsLfQr40LC|VNMyU}oW*AQy&mu1S8Zss)j8jHqvjwPUnpNgP^DgsV^I`ZF zpTU>?9yB}8x`1U*23aE*wPr9{-G{ySlJ&av5hUnQ>s&h@`)xhq_3sAS1qTJM36=$? z1{VYu2cLj$+Y#IwJV;)_&IB^GxF(2kwBdUogEXJNjlUb#)jRx$@HhYBn+VNWeDQAK zAz?Lk)Jj*bv(=Z>3{7Nq`4DKeGFaqGkRy2%KHw|bcI_j`!5JM4$!R*HQ->}#EAs2gEPud>%dzI|?|!$!^wlm?~*9)+fQ7x|K}1D&C# zE(_*>4i7-Sy@`AcG!=3r&K_wB{CD9q;Q5C@f!mRBc$$Ba-wPk?9^nz#tG@`X{R5d7 zzsP^T|4GD)-hfs5C8FUc{Eb8b(aOu|)4QZ!zL^>h0!!8izEP1#*N4`zI8$SB$pv_P6-*OVHkIRsgxEa3EGUX9i zjGL6L%KOT0_~$>tUThB8mIVsTP&dIt`Uo+`{m@7!;3KurT5D|)|LK7Y*GyP|&oG(x zx0a~4)X#w~>I7W3F*?BC&VZg7j_BdF#w_Dj*mIi^A1CScE#f)E|Bc`UrI{nl3CzP@ zfr!o)ctDM#y&45wMk5g}Y}ZL!|9c3aO(rhOhDilU|o0PBWgxXcl6Ryc&E1(dt7K zpE;7iEyEsZh>TiSUPX+iFF%oAgRI3%{5Jjv$gdN8E1?~tf0rWqH$&Jcd@X#>D0V)) zi*)}We-3PlN$@J>`|t4I?SIeT1UBMGaTffAWsq5Gm~HqDyoE2}2Ok$3Alfn%)G9^{ z`4MR?%V>NnHG|Z;2ziV_h_77F;>8rJ{}4H(v!RVFrH9g28LW&(B;|Q!v+@>b^@VZ} z7UFNP?OQ<$k$pH;t-!9iNnHSI;$d|SEcsuMRZM|rdl~Xe;~=x{(3Zl6*r|P@?MIZZ zo!%9`>H-;V1nZ-AX0_D&vx5B=A9h&8f z!1u^8wubkZ9#pY^ih?%;t602tbMP(NKR6k26trmp>2(42kI37g&QR>5LRfqi{9I(2 z)+2WI8GoE_AaqA;c93v|5JHA&ns7a`2utA^zJ>Vg0p<<1^>>C1n1je{nSUzcWowZ$ z{T$Zb?}*Db7F&qz;P>&O4BLJn=r>oqSA1A}9vRj5#BapI;yF?WsjH+*y`*yF{1!@2 zAol;3^s#gpQCJ`By-Vd@uq&p?vtjp91ok~x`-f$+^Sdg#(hIs}8ho@h$~t8ucH4)_ zpGuN?4kG)#)na5_s?;Y~{ObtzSq3u8B<-fc&w3OV-!s}K*zgBfKJag?m3|4VcLiq# zhUq1Gg+2xT)e?OTVh|hkt@_9M&xk;rL{9KrX1^;&ckILv9|ON4 zKA#jk2c8&3u_D14!CQhWupf89w*Q8r@<GbnL;Vh>D);pMt$O4^j7JjK-Vb;geneDY8I+_(k~jJ;f~0 zceGdnzkV`e?{_i3?MJpZTf&bQB^#FGKeHVXFS zK-dg<$^=;SH!3$luiXnPaSdeYtI8Y7$Jn3M%8yDzWO<9#NjQtK1b+4x>d&z3FJn=r zT5k@EW78Ry|y3=c?4%1 zQUYBAJrU5x`mdyuiyc?n@JUl235$NuSrt|~ev&9_X zeiX1@AQmF`Rvz=O9!B162a}Qq#Gk~IVjHQOWJxbDTjM==R_8!MrptcWLbPNuEV`TJ z`w)Fzix|n*E?t%*%G>}EzYc0YWOzrwvnoV%;~qr%_QFs89%ojLs}#q$5^;>1APtuw zJN7(_V7#xLtCzAI1- z(O-(8y$30IkY(gKSb!q3SiSsXK-o-C>uNC{d*xdAz;ltOx?g-qd|Z5%dBZ#44ey6l z{*(BJ*hET_&X(FEKiVC!-E1i&g^{g1|*M<1`LbdzQ(-Ul1{E96U4F2KM@J#71v~7yJQoMBm`l z3T*Z64Y;M)XQ_zZ`(cG#!5@Hq-T=Arvq7h>!X=1J^%D9qZ+NUQ0okEzh53lsFB0xY z2K7juEmBlVb zW2ZfcNZ{*;pznee@+~yh@1R{1>ntn95}Dr0Le6rWA!iKvm)!u*a>noS*lCvK{7U`>{v6nY9YK*1 zIG0fZMdCVu#|!w_*A?=MF#xC&ID(+O*l4gMaK z_#LMbT8kZUYNI!cG#7~z5osps+{?})tVK*QK}wX`N`s}Vr13b*u~^y;iZzg1%IzQv zyUYFMY!=Iyjr_>hppg&sxdfRJqE98X(k-y@m*YIaPFRflaHgP@+L4_oFkmm1!RlD3 zE=Dx*MfGi*65FlrQ%~U(Ofy*dB5aTVPPSbEyRjG%jOoblJ_kEwE4<#XwL@AGEdGwL zL{vS9Ebm}M6N?~0Bl-;HaZx_x9Tt5$A2Ez^ustYV*Z?t$baOJ|x37a>ieCo{ehV^PC;7#UIxivG@Fg;+rw|Wp;Xe=7;Klyg$YX70 z-qs2KDP{$pFJ6M!?&a{eu0jrL3G$_nirdAH#V;V~eiR!r87E7b(q)iwS4tCL3(iEg zbRn#S?eM(z;uP3#@V+>?nS8Mr6Hp<)Sd_2-wCT>HT*0aKGksK!6ze4Qy2n!ei9_z9N{+PCLdzC@QuQ|!d~pLixI=U1-^1S z_*)hzHVpRq8fYWOk~>Q}2eFH8h+g!NE{8T+hTO}3XrC+P0?4+xI4AZYa@L)dbfu3n zOvy!b;wIz|?|?`ABy6}h5an~S)E6RKvJJZEYiOh2p^IpDbcPRXL6QwaEQt2UOzmcE z70&K$)BeOc&vIm+yTAkPfzx=SkZmqT)aMgF7m|R+DDmx+lt9439<1&UO6iVMOBIVwi0vw1(w804G?+L4!<3H12lb^%3CpMPVy; z$9~~Q$gV~>U(nXy0Xsy+`7%1kGT(nE^vAQX_`dgdfCccRxJk@mrv+x?WJ-d3CbG8V z!S;|Z$Em03%!7Sh{uumy0$HoGl#9US8X~F#aRMbDQScJPRjXKx?H!!Tqgc;#YEO2e zgfdJAkljzvDXMdcE+dDO2e~p&e^P%H=N-RhIo6hlY5RO8jcFl+dId5M5kwFUTPK0rGwn9WJ6vQdwrO{_bD*=QAUAs0K4!NHWZ6!ugp z^E#gZMqfab^WUuD@#5_`clLm|ie<__MLzKa;?`Xd;gsNoWI{(Dl`?R?rx&7`WGzjX z@09O_-TO4`-dAzz;(fWJG5}HPtC3M~GT$2!wfqFW$6-X)64XR^9eplre;h_ca1uOi5pJOR7m*c(igB{PcU1F{E*8L zTN@3@J_%Wbs{g0Gv;C>E4&(Tl9E;5IL}1iNn4(dmywA;j?sK2ReGd4L)1sn;$xIhC zDwb$4(Qttg&;X^h#E0;-p;4jLf&}sb7b-JatT1_j4p}j`s7^)Cl(hO>KdLv)KcFq& z@cwu1>$<+z_xrgf{bZ--faj2MZ7x7xXW%Kn1$p`%d;TNL+DcrRz5Eir5Wmxu8cMQs zMVc;Gil~^3XQ$O?O+(LWzH(fdM%aQwbaf}1HP%0yzHYJ2-vceRf;4Ue^vY>EdK6Q2 zGuy_b8zaP~gS~eHXG`)i}xNTTbqx^vXoa}VdNQW$pgx300a zk*MvnUbBv(YKE;ClIpeW4d#@qaga}G{ZJC;wQumhqTnKS zyZ6y|uE7JjO>J;n(EYEet}R>oXZly%G5n!Vht!!#if!O?J*(dQmz0O#3@eOn>}uj? zT?OxzfTQJyz`2)+`LI$io5)ah(|JZc3l!mX((Hp%{ob4~MeP@QpCSosM(uyXtwETq zMEI?E>sGSqz+aw60ZOt87c#`8{KLv3`D%bRox(F4|*n#Sl z=js0YQ7!Gb#FDsto$@;laU?49cKZK9m2wprPa5TrQqPfN4jc2}iXZgk(RWUJZl?F= z!ai+K->Vy^9h z8elG7@jC8HdT>3KK>j|$6t1w(+86AZB*?chfrF^~%s{rPBpZ_R$iBO zQ(FAwB?lSG6h}RpW(H~hBHmv}^3`zTW8{kCc!Ag9|Gk2~KL)S%J<4UKo}e}_6SwLq z7@v3a!}>{mP#2y%jIVUH5rez8j<5YiV>b@p>qZ+a?Rj{d7jaO)xPvI z?>UESjR(9%@E0|_=6>&+-g7WAb4Woln5G-acI)ZfjjESqkUu?6_OyfEea<(`t-zNg zg1<0XucD*G;yh%NLOq5iEcS1Lt$xYBpD(@*)pFh+McVE3ItY7&p06t8v#`ezM^R(Y@z-?lN>M0#=rdge>|(Y4(C+?JpTeR22+I-)BN1mNn3`$e1uZ4tU1b)Ma8!_*TJkmWm7UyR@=%^)O2Y;hVzzHV&T?^%M)KnXIlVGa=CO*^x_`>-G47O%N9C zP)@zRK6R-kH)?X77K`dlhIUHl<{^u|RzQ80;j(XM?l)7Pa*x-i2+oV@elHUJ8;9$w zk(?}Mlg>$9MYR^CR={60a9!1cmnfHY{miC|XyI|P&FOF$38X0oig>A=VXwlMDxxb^ z+qL-fAvl{>=2s7jVGxHg%)a6v?~Eq#OoCRosp-r>E*iOnouw9y911j%N4Mh^_d>1@ zQPpEiJ*T>}lnYC_t(2?EeD?NI$hdmCYZJE;?NFS(RJPps$#tLH^~pt_Tzko#R~8$5 z0rX}WS?P9kNHaA1VTheRc6qt{lAA9_W`x=^WnRjplo=`0F^B8ALTKX(NCWZ9TDYw1 zVoLUF12D&<^y>+fxr^;Skx6Nx5;Gtayi8PNKHa^Pl&7AQrwKo;os_3n)lQfTGU2u?RWHpcEhx(&yc?IQj5zWg zx#KaYj>W1za;cCaql9@-O@#=p*=)2@CEe)Feq(?txv1*I;c?P)5~&h{R6Pe5r-_T6 z0d%Mf=3S!#O3YFmga*F-c4mis_hAy+AJy0I@H*MWT;6C^0~%G3>CK`7^2sPJR|PbU K|Ns4`U*Jz5{B3Oj literal 0 HcmV?d00001 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst new file mode 100644 index 00000000..a8d462a7 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst @@ -0,0 +1,91 @@ +Documentation: http://chrissimpkins.github.io/crypto/ + +Description +------------- + +crypto provides a simple interface to symmetric Gnu Privacy Guard (gpg) encryption and decryption for one or more files on Unix and Linux platforms. It runs on top of gpg and requires a gpg install on your system. Encryption is performed with the AES256 cipher algorithm. `Benchmarks relative to default gpg settings are available for text and binary file mime types `_. + +crypto provides a number of options including automated tar archives of multiple files prior to encryption, portable ASCII armored encryption formatting, and SHA256 hash digest generation for your encrypted files. You can view all available options in the `usage documentation `_ or with the ``--help`` option. + +Tested in cPython 2.7.x, 3.4.x, and pypy 2.4.x (Python version 2.7.9) + + +Install +--------- + +Install with ``pip`` using the command: + +.. code-block:: bash + + $ pip install crypto + +or `download the source repository `_, unpack it, and navigate to the top level of the repository. Then enter: + +.. code-block:: bash + + $ python setup.py install + + +Upgrade +----------- + +You can upgrade your crypto version with the command: + +.. code-block:: bash + + $ pip install --upgrade crypto + + +Usage +--------- + +Encryption (crypto) +^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ crypto [file path] + +.. code-block:: bash + + $ crypto [directory path] + + +Decryption (decrypto) +^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ decrypto [file path] + +.. code-block:: bash + + $ decrypto [directory path] + + +You can find all available options in the `documentation `_ or by using one of the following commands: + +.. code-block:: bash + + $ crypto --help + $ decrypto --help + + +Frequently Asked Questions +------------------------------- + +`FAQ link `_ + + +Issue Reporting +------------------- + +Issue reporting is available on the `GitHub repository `_ + + +Changelog +------------ + +`Changelog link `_ + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/METADATA b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/METADATA new file mode 100644 index 00000000..a47264e3 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/METADATA @@ -0,0 +1,116 @@ +Metadata-Version: 2.0 +Name: crypto +Version: 1.4.1 +Summary: Simple symmetric GPG file encryption and decryption +Home-page: https://github.com/chrissimpkins/crypto +Author: Christopher Simpkins +Author-email: git.simpkins@gmail.com +License: MIT license +Keywords: encryption,decryption,gpg,pgp,openpgp,cipher,AES256,crypto,cryptography,security,privacy +Platform: any +Classifier: Intended Audience :: End Users/Desktop +Classifier: Topic :: Security :: Cryptography +Classifier: Topic :: Security +Classifier: Development Status :: 5 - Production/Stable +Classifier: Natural Language :: English +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX +Classifier: Operating System :: Unix +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 3 +Requires-Dist: Naked +Requires-Dist: shellescape + +Documentation: http://chrissimpkins.github.io/crypto/ + +Description +------------- + +crypto provides a simple interface to symmetric Gnu Privacy Guard (gpg) encryption and decryption for one or more files on Unix and Linux platforms. It runs on top of gpg and requires a gpg install on your system. Encryption is performed with the AES256 cipher algorithm. `Benchmarks relative to default gpg settings are available for text and binary file mime types `_. + +crypto provides a number of options including automated tar archives of multiple files prior to encryption, portable ASCII armored encryption formatting, and SHA256 hash digest generation for your encrypted files. You can view all available options in the `usage documentation `_ or with the ``--help`` option. + +Tested in cPython 2.7.x, 3.4.x, and pypy 2.4.x (Python version 2.7.9) + + +Install +--------- + +Install with ``pip`` using the command: + +.. code-block:: bash + + $ pip install crypto + +or `download the source repository `_, unpack it, and navigate to the top level of the repository. Then enter: + +.. code-block:: bash + + $ python setup.py install + + +Upgrade +----------- + +You can upgrade your crypto version with the command: + +.. code-block:: bash + + $ pip install --upgrade crypto + + +Usage +--------- + +Encryption (crypto) +^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ crypto [file path] + +.. code-block:: bash + + $ crypto [directory path] + + +Decryption (decrypto) +^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ decrypto [file path] + +.. code-block:: bash + + $ decrypto [directory path] + + +You can find all available options in the `documentation `_ or by using one of the following commands: + +.. code-block:: bash + + $ crypto --help + $ decrypto --help + + +Frequently Asked Questions +------------------------------- + +`FAQ link `_ + + +Issue Reporting +------------------- + +Issue reporting is available on the `GitHub repository `_ + + +Changelog +------------ + +`Changelog link `_ + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/RECORD new file mode 100644 index 00000000..037e7955 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/RECORD @@ -0,0 +1,28 @@ +../../Scripts/crypto.exe,sha256=p3AgdHe-v7ncFcENaBUjHJ10ndwkAZd6dnzRmZKYpus,93000 +../../Scripts/decrypto.exe,sha256=MYU2xn0LykZbbYskB8hTEIMqIKPNE9TTNDS3wkW1SbI,93008 +crypto-1.4.1.data/scripts/crypto,sha256=JiOIH9vUcNmsPUqHi3sD7wa-KshHSSHsWwYxdJxquFU,287 +crypto-1.4.1.data/scripts/decrypto,sha256=GFVx1pyc7wga_NuKaO5IN4VpiC-iB1nXFIzvwRKs-QI,291 +crypto-1.4.1.dist-info/DESCRIPTION.rst,sha256=cUnYN7Bc2SHYRPCbrgoiwqxsilKu-F870exbHPzYyqg,2406 +crypto-1.4.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +crypto-1.4.1.dist-info/METADATA,sha256=kQ8T3QfQ00YZ0ETfqAgpzT7JjQZyAtcbpdD4eO-LyfY,3354 +crypto-1.4.1.dist-info/RECORD,, +crypto-1.4.1.dist-info/WHEEL,sha256=SXYYsi-y-rEGIva8sB8iKF6bAFD6YDhmqHX5hI3fc0o,110 +crypto-1.4.1.dist-info/entry_points.txt,sha256=c4pXwtenCFUlTF9DHcgCWqXZChpJwNtbSjtfQMhrm3M,79 +crypto-1.4.1.dist-info/pydist.json,sha256=Q2O_1hp0_7IBZ-JTH9MYE5-GNhTxeT1KqjRvp6U8YAs,1261 +crypto-1.4.1.dist-info/top_level.txt,sha256=iQrOUgmGXiXK01vJOH4JP-6x-yip7JIM4OEshevZ9wE,7 +crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +crypto/__pycache__/__init__.cpython-37.pyc,, +crypto/__pycache__/app.cpython-37.pyc,, +crypto/__pycache__/decryptoapp.cpython-37.pyc,, +crypto/__pycache__/settings.cpython-37.pyc,, +crypto/app.py,sha256=m9usVyS7G-vg7YYx7rVV1DWohss5xlKKq5vV-viSi8o,13952 +crypto/decryptoapp.py,sha256=5hJEh55vyHSgMUkIp2PdYn5P1Z6qkFdrAnsu8EhJZ8c,22448 +crypto/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +crypto/library/__pycache__/__init__.cpython-37.pyc,, +crypto/library/__pycache__/cryptor.cpython-37.pyc,, +crypto/library/__pycache__/hash.cpython-37.pyc,, +crypto/library/__pycache__/package.cpython-37.pyc,, +crypto/library/cryptor.py,sha256=0A6KMRsRo7UpfFw0qTbaVByqIRqO4bGSbckgR9fH-RQ,8934 +crypto/library/hash.py,sha256=HVO5NcCRVHJRYOIAMTHlxzk1wWAeYuon2QwiRHJJaAY,847 +crypto/library/package.py,sha256=mTXHpmJFRKqx_KGRN1bUfSei8duBARZKtH4hBQzXAi4,1754 +crypto/settings.py,sha256=d--yWR6fCw10JO3tyQhCY1z36PzPsW7ElRmcikNd8vg,4506 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL new file mode 100644 index 00000000..f2ddc351 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.22.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt new file mode 100644 index 00000000..ff85480c --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt @@ -0,0 +1,4 @@ +[console_scripts] +crypto = crypto.app:main +decrypto = crypto.decryptoapp:main + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json new file mode 100644 index 00000000..c05d1712 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json @@ -0,0 +1 @@ +{"license": "MIT license", "exports": {"console_scripts": {"crypto": "crypto.app:main", "decrypto": "crypto.decryptoapp:main"}}, "document_names": {"description": "DESCRIPTION.rst"}, "name": "crypto", "metadata_version": "2.0", "contacts": [{"role": "author", "email": "git.simpkins@gmail.com", "name": "Christopher Simpkins"}], "generator": "bdist_wheel (0.22.0)", "commands": {"wrap_console": {"crypto": "crypto.app:main", "decrypto": "crypto.decryptoapp:main"}}, "summary": "Simple symmetric GPG file encryption and decryption", "project_urls": {"Home": "https://github.com/chrissimpkins/crypto"}, "platform": "any", "run_requires": [{"requires": ["Naked", "shellescape"]}], "version": "1.4.1", "keywords": "encryption,decryption,gpg,pgp,openpgp,cipher,AES256,crypto,cryptography,security,privacy", "classifiers": ["Intended Audience :: End Users/Desktop", "Topic :: Security :: Cryptography", "Topic :: Security", "Development Status :: 5 - Production/Stable", "Natural Language :: English", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3"], "extras": []} \ No newline at end of file diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt new file mode 100644 index 00000000..0ed56794 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt @@ -0,0 +1 @@ +crypto diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/app.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/app.py new file mode 100644 index 00000000..e9302392 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/app.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# crypto +# Copyright 2015 Christopher Simpkins +# MIT license +# ------------------------------------------------------------------------------ + +# Application start + + +def main(): + import sys + import getpass + from Naked.commandline import Command + from Naked.toolshed.system import dir_exists, file_exists, list_all_files, make_path, stderr + + # ------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + # ------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + # ------------------------------------------------------------------------------------------ + # [ VALIDATION LOGIC ] - early validation of appropriate command syntax + # Test that user entered at least one argument to the executable, print usage if not + # ------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(1) + # ------------------------------------------------------------------------------------------ + # [ HELP, VERSION, USAGE LOGIC ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/crypto/settings.py file + # ------------------------------------------------------------------------------------------ + if c.help(): # User requested crypto help information + from crypto.settings import help as crypto_help + print(crypto_help) + sys.exit(0) + elif c.usage(): # User requested crypto usage information + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(0) + elif c.version(): # User requested crypto version information + from crypto.settings import app_name, major_version, minor_version, patch_version + version_display_string = app_name + ' ' + major_version + '.' + minor_version + '.' + patch_version + print(version_display_string) + sys.exit(0) + # ------------------------------------------------------------------------------------------ + # [ APPLICATION LOGIC ] + # + # ------------------------------------------------------------------------------------------ + elif c.argc > 1: + # code for multi-file processing and commands that include options + # ASCII ARMOR SWITCH + ascii_armored = False + if c.option('--armor') or c.option('-a'): + ascii_armored = True + + # MAX COMPRESS / COMPRESS ALL SWITCH + max_compress = False + if c.option('--space'): + max_compress = True + + # NO COMPRESSION SWITCH + no_compress = False + if c.option('--speed'): + no_compress = True + + # SECURE HASH DIGEST REPORT SWITCH + report_checksum = False + if c.option('--hash'): + report_checksum = True + + # TAR FOLDERS SWITCH + tar_folders = False + if c.option('--tar'): + tar_folders = True + + directory_list = [] # directory paths included in the user entered paths from the command line + tar_directory_list = [] # directories, which need to be packaged as tar archives + file_list = [] # file paths included in the user entered paths from the command line (and inside directories entered) + + # dot and .crypt file flags for exclusion testing + contained_dot_file = False + contained_crypt_file = False + + # determine if argument is an existing file or directory + for argument in c.argv: + if file_exists(argument): + if argument.endswith('.crypt'): # do not include previously encrypted files + contained_crypt_file = True + else: + file_list.append(argument) # add appropriate file paths to the file_list + elif dir_exists(argument): + directory_list.append(argument) # if it is a directory, add path to the directory_list + + # add all file paths from user specified directories to the file_list + if len(directory_list) > 0: + if not tar_folders: + for directory in directory_list: + directory_file_list = list_all_files(directory) + for contained_file in directory_file_list: + if contained_file[0] == ".": + contained_dot_file = True # change the flag + is not included in file_list intentionally (no dot files) + elif contained_file.endswith('.crypt'): + contained_crypt_file = True # change the flag + is not included in file_list intentionally (no previously encrypted files) + else: + # otherwise add to the list for encryption + contained_file_path = make_path(directory, contained_file) + file_list.append(contained_file_path) + else: + # create (uncompressed) tar archive for every targeted folder and add the resulting archive to the file_list + # do not start tar file creation, yet (!) - it is more convenient for the user to first enter the passphrase then start processing + for directory in directory_list: + directory_file_path = directory + '.tar' + tar_directory_list.append(directory) + file_list.append(directory_file_path) + + # confirm that there are files to be encrypted, if not warn user + if len(file_list) == 0: + if contained_dot_file is True or contained_crypt_file is True: + stderr("There were no files identified for encryption. crypto does not encrypt dot files or previously encrypted '.crypt' files.") + sys.exit(1) + else: + stderr("Unable to identify files for encryption") + sys.exit(1) + else: + # file_list should contain all filepaths from either user specified file paths or contained in top level of directory, encrypt them + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + + # create temporary tar-files + tar_list = [] + if len(tar_directory_list) > 0: + from crypto.library import package + tar_list = package.generate_tar_files(tar_directory_list) + for t in tar_list: + if t not in file_list: # check to confirm that the tar archive is in the list of files to encrypt + if file_exists(t): + # append the tarfile to the file_list for encryption if it was not included in the file list for encryption + file_list.append(t) + else: + stderr("There was an error with the tar archive creation. Please try again.", exit=1) + + from crypto.library.cryptor import Cryptor + the_cryptor = Cryptor(passphrase) + + # run encryption based upon any passed switches + if ascii_armored: + if max_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=True, armored=True, checksum=report_checksum) + elif no_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=True, force_compress=False, armored=True, checksum=report_checksum) + else: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=False, armored=True, checksum=report_checksum) + else: + if max_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=True, armored=False, checksum=report_checksum) + elif no_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=True, force_compress=False, armored=False, checksum=report_checksum) + else: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=False, armored=False, checksum=report_checksum) + + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + the_cryptor.cleanup() + + # tmp tar file removal (generated with package.generate_tar_files function above) + if len(tar_list) > 0: + from crypto.library import package + package.remove_tar_files(tar_list) + else: + # passphrases did not match, report to user and abort + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + + elif c.argc == 1: + # simple single file or directory processing with default settings + path = c.arg0 + if file_exists(path): + # it is a file, encrypt the single file with default settings + # confirm that it is not already encrypted, abort if so + if path.endswith('.crypt'): + stderr("You are attempting to encrypt an encrypted file. Please delete the .crypt file and repeat encryption with the original file if this is your intent.") + sys.exit(1) + # if passes test above, obtain passphrase from the user + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + from crypto.library.cryptor import Cryptor + the_cryptor = Cryptor(passphrase) + the_cryptor.encrypt_file(path) + the_cryptor.cleanup() + else: + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + elif dir_exists(path): + # it is a directory, encrypt all top level files with default settings + dirty_directory_file_list = list_all_files(path) + # remove dot files and previously encrypted files (with .crypt suffix) from the list of directory files + clean_directory_file_list = [x for x in dirty_directory_file_list if x[0] != "." and x.endswith(".crypt") is False] # remove dotfiles and .crypt files + + # confirm that there are still files in the list after the dot files and encrypted files are removed + if len(clean_directory_file_list) == 0: + stderr("There are no unencrypted files in the directory.") + sys.exit(1) + + # create relative file paths for each file in the clean_directory_file_list + clean_directory_file_list_relpaths = [] + for clean_file in clean_directory_file_list: + new_file_path = make_path(path, clean_file) + clean_directory_file_list_relpaths.append(new_file_path) + + # prompt for the passphrase + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + from crypto.library.cryptor import Cryptor + the_cryptor = Cryptor(passphrase) + the_cryptor.encrypt_files(clean_directory_file_list_relpaths) # encrypt the list of directory files + the_cryptor.cleanup() + else: + # passphrases do not match + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + else: + # error message, not a file or directory. user entry error + stderr("The path that you entered does not appear to be an existing file or directory. Please try again.") + sys.exit(1) + + # ------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + # ------------------------------------------------------------------------------------------ + else: + print("Could not complete your request. Please try again.") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/decryptoapp.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/decryptoapp.py new file mode 100644 index 00000000..0528d3f6 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/decryptoapp.py @@ -0,0 +1,380 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# decrypto +# Copyright 2015 Christopher Simpkins +# MIT license +# ------------------------------------------------------------------------------ + +# Application start +def main(): + import os + import sys + from time import sleep + import getpass + import tarfile + from Naked.commandline import Command + from Naked.toolshed.shell import execute, muterun + from Naked.toolshed.system import dir_exists, file_exists, list_all_files, make_path, stdout, stderr, is_dir + from shellescape import quote + + # ------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + # ------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + # ------------------------------------------------------------------------------------------ + # [ VALIDATION LOGIC ] - early validation of appropriate command syntax + # Test that user entered at least one argument to the executable, print usage if not + # ------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(1) + # ------------------------------------------------------------------------------------------ + # [ HELP, VERSION, USAGE LOGIC ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/crypto/settings.py file + # ------------------------------------------------------------------------------------------ + if c.help(): # User requested crypto help information + from crypto.settings import help as crypto_help + print(crypto_help) + sys.exit(0) + elif c.usage(): # User requested crypto usage information + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(0) + elif c.version(): # User requested crypto version information + from crypto.settings import app_name, major_version, minor_version, patch_version + version_display_string = app_name + ' ' + major_version + '.' + minor_version + '.' + patch_version + print(version_display_string) + sys.exit(0) + # ------------------------------------------------------------------------------------------ + # [ APPLICATION LOGIC ] + # + # ------------------------------------------------------------------------------------------ + elif c.argc > 1: + # code for multi-file processing and commands that include options + use_standard_output = False # print to stdout flag + use_file_overwrite = False # overwrite existing file + untar_archives = True # untar decrypted tar archives, true by default + + # set user option flags + if c.option('--stdout') or c.option('-s'): + use_standard_output = True + if c.option('--overwrite') or c.option('-o'): + use_file_overwrite = True + if c.option('--nountar'): + untar_archives = False + + directory_list = [] # directory paths included in the user entered paths from the command line + file_list = [] # file paths included in the user entered paths from the command line (and inside directories entered) + + for argument in c.argv: + if file_exists(argument): # user included a file, add it to the file_list for decryption + if argument.endswith('.crypt'): + file_list.append(argument) # add .crypt files to the list of files for decryption + elif argument.endswith('.gpg'): + file_list.append(argument) + elif argument.endswith('.asc'): + file_list.append(argument) + elif argument.endswith('.pgp'): + file_list.append(argument) + else: + # cannot identify as an encrypted file, give it a shot anyways but warn user + file_list.append(argument) + stdout("Could not confirm that '" + argument + "' is encrypted based upon the file type. Attempting decryption. Keep your fingers crossed...") + elif dir_exists(argument): # user included a directory, add it to the directory_list + directory_list.append(argument) + else: + if argument[0] == "-": + pass # if it is an option, do nothing + else: + stderr("'" + argument + "' does not appear to be an existing file or directory. Aborting decryption attempt for this request.") + + # unroll the contained directory files into the file_list IF they are encrypted file types + if len(directory_list) > 0: + for directory in directory_list: + directory_file_list = list_all_files(directory) + for contained_file in directory_file_list: + if contained_file.endswith('.crypt'): + file_list.append(make_path(directory, contained_file)) # include the file with a filepath 'directory path/contained_file path' + elif contained_file.endswith('.gpg'): + file_list.append(make_path(directory, contained_file)) + elif contained_file.endswith('asc'): + file_list.append(make_path(directory, contained_file)) + elif contained_file.endswith('.pgp'): + file_list.append(make_path(directory, contained_file)) + + # confirm that there are files for decryption, if not abort + if len(file_list) == 0: + stderr("Could not identify files for decryption") + sys.exit(1) + + # get passphrase used to symmetrically decrypt the file + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + # begin decryption of each requested file. the directory path was already added to the file path above + for encrypted_file in file_list: + # create the decrypted file name + decrypted_filename = "" + if encrypted_file.endswith('.crypt'): + decrypted_filename = encrypted_file[0:-6] + elif encrypted_file.endswith('.gpg') or encrypted_file.endswith('.asc') or encrypted_file.endswith('.pgp'): + decrypted_filename = encrypted_file[0:-4] + else: + decrypted_filename = encrypted_file + '.decrypt' # if it was a file without a known encrypted file type, add the .decrypt suffix + + # determine whether file overwrite will take place with the decrypted file + skip_file = False # flag that indicates this file should not be encrypted + created_tmp_files = False + if not use_standard_output: # if not writing a file, no need to check for overwrite + if file_exists(decrypted_filename): + if use_file_overwrite: # rename the existing file to temp file which will be erased or replaced (on decryption failures) below + tmp_filename = decrypted_filename + '.tmp' + os.rename(decrypted_filename, tmp_filename) + created_tmp_files = True + else: + stdout("The file path '" + decrypted_filename + "' already exists. This file was not decrypted.") + skip_file = True + + # begin decryption + if not skip_file: + if use_standard_output: # using --quiet flag to suppress stdout messages from gpg, just want the file data in stdout stream + system_command = "gpg --batch --quiet --passphrase " + quote(passphrase) + " -d " + quote(encrypted_file) + successful_execution = execute(system_command) # use naked execute function to directly push to stdout, rather than return stdout + + if not successful_execution: + stderr("Unable to decrypt file '" + encrypted_file + "'", 0) + if created_tmp_files: # restore the moved tmp file to original if decrypt failed + tmp_filename = decrypted_filename + '.tmp' + if file_exists(tmp_filename): + os.rename(tmp_filename, decrypted_filename) + else: # decryption successful but we are in stdout flag so do not include any other output from decrypto + pass + else: + system_command = "gpg --batch -o " + quote(decrypted_filename) + " --passphrase " + quote(passphrase) + " -d " + quote(encrypted_file) + response = muterun(system_command) + + if response.exitcode == 0: + stdout("'" + encrypted_file + "' decrypted to '" + decrypted_filename + "'") + else: # failed decryption + if created_tmp_files: # restore the moved tmp file to original if decrypt failed + tmp_filename = decrypted_filename + '.tmp' + if file_exists(tmp_filename): + os.rename(tmp_filename, decrypted_filename) + # report the error + stderr(response.stderr) + stderr("Decryption failed for " + encrypted_file) + + # cleanup: remove the tmp file + if created_tmp_files: + tmp_filename = decrypted_filename + '.tmp' + if file_exists(tmp_filename): + os.remove(tmp_filename) + + # untar/extract any detected archive file(s) + if untar_archives is True: + if decrypted_filename.endswith('.tar') and tarfile.is_tarfile(decrypted_filename): + untar_path_tuple = os.path.split(decrypted_filename) + untar_path = untar_path_tuple[0] + if use_file_overwrite: + with tarfile.open(decrypted_filename) as tar: + if len(untar_path) > 0: + tar.extractall(path=untar_path) # use dir path from the decrypted_filename if not CWD + stdout("'" + decrypted_filename + "' unpacked in the directory path '" + untar_path + "'") + else: + tar.extractall() # else use CWD + stdout("'" + decrypted_filename + "' unpacked in the current working directory") + else: + with tarfile.TarFile(decrypted_filename, 'r', errorlevel=1) as tar: + for tarinfo in tar: + t_file = tarinfo.name + if len(untar_path) > 0: + t_file_path = os.path.join(untar_path, t_file) + else: + t_file_path = t_file + if not os.path.exists(t_file_path): + try: + if len(untar_path) > 0: + tar.extract(t_file, path=untar_path) # write to the appropriate dir + else: + tar.extract(t_file) # write to CWD + except IOError as e: + stderr( + "Failed to unpack the file '" + t_file_path + "' [" + str( + e) + "]") + elif is_dir(t_file_path): + pass # do nothing if it exists and is a directory, no need to warn + else: # it is a file and it already exists, provide user error message + stderr( + "Failed to unpack the file '" + t_file_path + "'. File already exists. Use the --overwrite flag to replace existing files.") + + # remove the decrypted tar archive file + os.remove(decrypted_filename) + + # overwrite the entered passphrases after file decryption is complete for all files + passphrase = "" + passphrase_confirm = "" + + # add a short pause to hinder brute force pexpect style password attacks with decrypto + sleep(0.2) # 200ms pause + + else: # passphrases did not match + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + + elif c.argc == 1: + # simple single file or directory processing with default settings + path = c.arg0 + if file_exists(path): # SINGLE FILE + check_existing_file = False # check for a file with the name of new decrypted filename in the directory + + if path.endswith('.crypt'): + decrypted_filename = path[0:-6] # remove the .crypt suffix + check_existing_file = True + elif path.endswith('.gpg') or path.endswith('.pgp') or path.endswith('.asc'): + decrypted_filename = path[0:-4] + check_existing_file = True + else: + decrypted_filename = path + ".decrypt" # if there is not a standard file type, then add a .decrypt suffix to the decrypted file name + stdout("Could not confirm that the requested file is encrypted based upon the file type. Attempting decryption. Keep your fingers crossed...") + + # confirm that the decrypted path does not already exist, if so abort with warning message to user + if check_existing_file is True: + if file_exists(decrypted_filename): + stderr("Your file will be decrypted to '" + decrypted_filename + "' and this file path already exists. Please move the file or use the --overwrite option with your command if you intend to replace the current file.") + sys.exit(1) + + # get passphrase used to symmetrically decrypt the file + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + # confirm that the passphrases match + if passphrase == passphrase_confirm: + system_command = "gpg --batch -o " + quote(decrypted_filename) + " --passphrase " + quote(passphrase) + " -d " + quote(path) + response = muterun(system_command) + + if response.exitcode == 0: + # unpack tar archive generated from the decryption, if present + if decrypted_filename.endswith('.tar') and tarfile.is_tarfile(decrypted_filename): + untar_path_tuple = os.path.split(decrypted_filename) + untar_path = untar_path_tuple[0] + + with tarfile.TarFile(decrypted_filename, 'r', errorlevel=1) as tar: + for tarinfo in tar: + t_file = tarinfo.name + if len(untar_path) > 0: + t_file_path = os.path.join(untar_path, t_file) + else: + t_file_path = t_file + if not os.path.exists(t_file_path): + try: + if len(untar_path) > 0: + tar.extract(t_file, path=untar_path) # write to the appropriate dir + else: + tar.extract(t_file) # write to CWD + except IOError as e: + stderr("Failed to unpack the file '" + t_file_path + "' [" + str(e) + "]") + elif is_dir(t_file_path): + pass # do nothing if it exists and is a directory, no need to warn + else: # it is a file and it already exists, provide user error message + stderr("Failed to unpack the file '" + t_file_path + "'. File already exists. Use the --overwrite flag to replace existing files.") + + # remove the decrypted tar archive + os.remove(decrypted_filename) + + stdout("Decryption complete") + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + sys.exit(0) + else: + stderr(response.stderr) + stderr("Decryption failed") + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + # add a short pause to hinder brute force pexpect style password attacks with decrypto + sleep(0.2) # 200ms pause + sys.exit(1) + else: + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + elif dir_exists(path): # SINGLE DIRECTORY + dirty_directory_file_list = list_all_files(path) + directory_file_list = [x for x in dirty_directory_file_list if (x.endswith('.crypt') or x.endswith('.gpg') or x.endswith('.pgp') or x.endswith('.asc'))] + + # if there are no encrypted files found, warn and abort + if len(directory_file_list) == 0: + stderr("There are no encrypted files in the directory") + sys.exit(1) + + # prompt for the passphrase + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + # decrypt all of the encypted files in the directory + for filepath in directory_file_list: + absolute_filepath = make_path(path, filepath) # combine the directory path and file name into absolute path + + # remove file suffix from the decrypted file path that writes to disk + if absolute_filepath.endswith('.crypt'): + decrypted_filepath = absolute_filepath[0:-6] # remove the .crypt suffix + elif absolute_filepath.endswith('.gpg') or absolute_filepath.endswith('.pgp') or absolute_filepath.endswith('.asc'): + decrypted_filepath = absolute_filepath[0:-4] + + # confirm that the file does not already exist + if file_exists(decrypted_filepath): + stdout("The file path '" + decrypted_filepath + "' already exists. This file was not decrypted.") + else: + system_command = "gpg --batch -o " + quote(decrypted_filepath) + " --passphrase " + quote(passphrase) + " -d " + quote(absolute_filepath) + response = muterun(system_command) + + if response.exitcode == 0: + stdout("'" + absolute_filepath + "' decrypted to '" + decrypted_filepath + "'") + else: + stderr(response.stderr) + stderr("Decryption failed for " + absolute_filepath) + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + + # add a short pause to hinder brute force pexpect style password attacks with decrypto + sleep(0.2) # 200ms pause + else: + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + else: + # error message, not a file or directory. user entry error + stderr("The path that you entered does not appear to be an existing file or directory. Please try again.") + sys.exit(1) + + # ------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + # ------------------------------------------------------------------------------------------ + else: + print("Could not complete your request. Please try again.") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/cryptor.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/cryptor.py new file mode 100644 index 00000000..49009bb4 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/cryptor.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +from Naked.toolshed.shell import muterun +from Naked.toolshed.system import file_size, stdout, stderr + +from shellescape import quote + +# ------------------------------------------------------------------------------ +# Cryptor class +# performs gpg encryption of one or more files +# ------------------------------------------------------------------------------ + + +class Cryptor(object): + """performs gpg encryption of one or more files""" + def __init__(self, passphrase): + self.command_default = "gpg -z 1 --batch --force-mdc --cipher-algo AES256 -o " + self.command_nocompress = "gpg -z 0 --batch --force-mdc --cipher-algo AES256 -o " + self.command_maxcompress = "gpg -z 7 --batch --force-mdc --cipher-algo AES256 -o " + self.command_default_armored = "gpg -z 1 --armor --batch --force-mdc --cipher-algo AES256 -o " + self.command_nocompress_armored = "gpg -z 0 --armor --batch --force-mdc --cipher-algo AES256 -o " + self.command_maxcompress_armored = "gpg -z 7 --armor --batch --force-mdc --cipher-algo AES256 -o " + self.passphrase = passphrase + self.common_binaries = set(['.7z', '.gz', '.aac', '.app', '.avi', '.azw', '.bz2', '.deb', '.doc', '.dmg', '.exe', '.flv', '.gif', '.jar', '.jpg', '.mov', '.mp3', '.mp4', '.odt', '.oga', '.ogg', '.ogm', '.pdf', '.pkg', '.png', '.ppt', '.pps', '.psd', '.rar', '.rpm', '.tar', '.tif', '.wav', '.wma', '.wmv', '.xls', '.zip', '.aiff', '.docx', '.epub', '.flac', '.mpeg', '.jpeg', '.pptx', '.xlsx']) + self.common_text = set(['.c', '.h', '.m', '.cc', '.js', '.pl', '.py', '.rb', '.sh', '.cpp', '.css', '.csv', '.php', '.rss', '.txt', '.xml', '.yml', '.java', '.json', '.html', '.yaml']) + + # ------------------------------------------------------------------------------ + # PUBLIC methods + # ------------------------------------------------------------------------------ + + # ------------------------------------------------------------------------------ + # encrypt_file : file encryption method + # ------------------------------------------------------------------------------ + def encrypt_file(self, inpath, force_nocompress=False, force_compress=False, armored=False, checksum=False): + """public method for single file encryption with optional compression, ASCII armored formatting, and file hash digest generation""" + if armored: + if force_compress: + command_stub = self.command_maxcompress_armored + elif force_nocompress: + command_stub = self.command_nocompress_armored + else: + if self._is_compress_filetype(inpath): + command_stub = self.command_default_armored + else: + command_stub = self.command_nocompress_armored + else: + if force_compress: + command_stub = self.command_maxcompress + elif force_nocompress: + command_stub = self.command_nocompress + else: + if self._is_compress_filetype(inpath): + command_stub = self.command_default + else: + command_stub = self.command_nocompress + + encrypted_outpath = self._create_outfilepath(inpath) + system_command = command_stub + encrypted_outpath + " --passphrase " + quote(self.passphrase) + " --symmetric " + quote(inpath) + + try: + response = muterun(system_command) + # check returned status code + if response.exitcode == 0: + stdout(encrypted_outpath + " was generated from " + inpath) + if checksum: # add a SHA256 hash digest of the encrypted file - requested by user --hash flag in command + from crypto.library import hash + encrypted_file_hash = hash.generate_hash(encrypted_outpath) + if len(encrypted_file_hash) == 64: + stdout("SHA256 hash digest for " + encrypted_outpath + " :") + stdout(encrypted_file_hash) + else: + stdout("Unable to generate a SHA256 hash digest for the file " + encrypted_outpath) + else: + stderr(response.stderr, 0) + stderr("Encryption failed") + sys.exit(1) + except Exception as e: + stderr("There was a problem with the execution of gpg. Encryption failed. Error: [" + str(e) + "]") + sys.exit(1) + + # ------------------------------------------------------------------------------ + # encrypt_files : multiple file encryption + # ------------------------------------------------------------------------------ + def encrypt_files(self, file_list, force_nocompress=False, force_compress=False, armored=False, checksum=False): + """public method for multiple file encryption with optional compression, ASCII armored formatting, and file hash digest generation""" + for the_file in file_list: + self.encrypt_file(the_file, force_nocompress, force_compress, armored, checksum) + + # ------------------------------------------------------------------------------ + # cleanup : overwrite the passphrase in memory + # ------------------------------------------------------------------------------ + def cleanup(self): + """public method that overwrites user passphrase in memory""" + self.passphrase = "" + + # ------------------------------------------------------------------------------ + # PRIVATE methods + # ------------------------------------------------------------------------------ + + def _create_outfilepath(self, inpath): + """private method that generates the crypto saved file path string with a .crypt file type""" + return inpath + '.crypt' + + def _is_compress_filetype(self, inpath): + """private method that performs magic number and size check on file to determine whether to compress the file""" + # check for common file type suffixes in order to avoid the need for file reads to check magic number for binary vs. text file + if self._is_common_binary(inpath): + return False + elif self._is_common_text(inpath): + return True + else: + # files > 10kB get checked for compression (arbitrary decision to skip compression on small files) + the_file_size = file_size(inpath) + if the_file_size > 10240: + if the_file_size > 512000: # seems to be a break point at ~ 500kb where file compression offset by additional file read, so limit tests to files > 500kB + try: + system_command = "file --mime-type -b " + quote(inpath) + response = muterun(system_command) + if response.stdout[0:5] == "text/": # check for a text file mime type + return True # appropriate size, appropriate file mime type + else: + return False # appropriate size, inappropriate file mime type + except Exception: + return False + else: + return True # if file size is < 500kB, skip the additional file read and just go with compression + else: + return False # below minimum size to consider compression, do not compress + + def _is_common_binary(self, inpath): + """private method to compare file path mime type to common binary file types""" + # make local variables for the available char numbers in the suffix types to be tested + two_suffix = inpath[-3:] + three_suffix = inpath[-4:] + four_suffix = inpath[-5:] + + # test for inclusion in the instance variable common_binaries (defined in __init__) + if two_suffix in self.common_binaries: + return True + elif three_suffix in self.common_binaries: + return True + elif four_suffix in self.common_binaries: + return True + else: + return False + + def _is_common_text(self, inpath): + """private method to compare file path mime type to common text file types""" + # make local variables for the available char numbers in the suffix types to be tested + one_suffix = inpath[-2:] + two_suffix = inpath[-3:] + three_suffix = inpath[-4:] + four_suffix = inpath[-5:] + + # test for inclusion in the instance variable common_text (defined in __init__) + if one_suffix in self.common_text: + return True + elif two_suffix in self.common_text: + return True + elif three_suffix in self.common_text: + return True + elif four_suffix in self.common_text: + return True + else: + return False diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/hash.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/hash.py new file mode 100644 index 00000000..8d66e37b --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/hash.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import hashlib +from Naked.toolshed.file import FileReader + +# ------------------------------------------------------------------------------ +# PUBLIC +# ------------------------------------------------------------------------------ +def generate_hash(filepath): + """Public function that reads a local file and generates a SHA256 hash digest for it""" + fr = FileReader(filepath) + data = fr.read_bin() + return _calculate_sha256(data) + + +# ------------------------------------------------------------------------------ +# PRIVATE +# ------------------------------------------------------------------------------ +def _calculate_sha256(binary_string): + """Private function that calculates a SHA256 hash digest for a binary string argument""" + return hashlib.sha256(binary_string).hexdigest() + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/package.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/package.py new file mode 100644 index 00000000..e4674ca2 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/library/package.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import tarfile +from Naked.toolshed.system import stderr, dir_exists, file_exists + +# ------------------------------------------------------------------------------ +# PUBLIC +# ------------------------------------------------------------------------------ + + +def generate_tar_files(directory_list): + """Public function that reads a list of local directories and generates tar archives from them""" + + tar_file_list = [] + + for directory in directory_list: + if dir_exists(directory): + _generate_tar(directory) # create the tar archive + tar_file_list.append(directory + '.tar') # append the tar archive filename to the returned tar_file_list list + else: + stderr("The directory '" + directory + "' does not exist and a tar archive could not be created from it.", exit=1) + + return tar_file_list + + +def remove_tar_files(file_list): + """Public function that removes temporary tar archive files in a local directory""" + for f in file_list: + if file_exists(f) and f.endswith('.tar'): + os.remove(f) # remove any tar files in the list, if it does not appear to be a tar file, leave it alone + +# ------------------------------------------------------------------------------ +# PRIVATE +# ------------------------------------------------------------------------------ + + +def _generate_tar(dir_path): + """Private function that reads a local directory and generates a tar archive from it""" + try: + with tarfile.open(dir_path + '.tar', 'w') as tar: + tar.add(dir_path) + except tarfile.TarError as e: + stderr("Error: tar archive creation failed [" + str(e) + "]", exit=1) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/settings.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/settings.py new file mode 100644 index 00000000..ebcebd1c --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/crypto/settings.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# Application Name +# ------------------------------------------------------------------------------ +app_name = 'crypto' + +# ------------------------------------------------------------------------------ +# Version Number +# ------------------------------------------------------------------------------ +major_version = "1" +minor_version = "4" +patch_version = "1" + +# ------------------------------------------------------------------------------ +# Debug Flag (switch to False for production release code) +# ------------------------------------------------------------------------------ +debug = False + +# ------------------------------------------------------------------------------ +# Usage String +# ------------------------------------------------------------------------------ +usage = """ +Encrypt by explicit file path: +------------------------------ + crypto [file path] + + +Encrypt all top level files in directory: +----------------------------------------- + crypto [directory path] + + +Create a tar archive from directory and encrypt the archive: +----------------------------------------------------------- + crypto --tar [directory path] + + +Decrypt by explicit file path: +------------------------------ + decrypto [file path] + + +Decrypt all top level encrypted files in directory: +--------------------------------------------------- + decrypto [directory path] + + +Enter `crypto --help` or `decrypto --help` to view the available options. + +""" + +# ------------------------------------------------------------------------------ +# Help String +# ------------------------------------------------------------------------------ +help = """ +------------------------------------------------- +crypto +Simple symmetric GPG file encryption +Copyright 2015 Christopher Simpkins +MIT license +Source: https://github.com/chrissimpkins/crypto +Docs: https://chrissimpkins.github.io/crypto/ +------------------------------------------------- + +ABOUT +crypto provides a simple interface to symmetric Gnu Privacy Guard (gpg) encryption and decryption for one or more files. gpg must be installed on your system in order to use the crypto and decrypto executables. + +USAGE + ENCRYPTION + crypto [file path] + crypto [directory path] + + DECRYPTION + decrypto [file path] + decrypto [directory path] + +CRYPTO OPTIONS + --armor | -a Use a portable ASCII armored encryption format + --hash Generate SHA256 hash digest of encrypted file(s) + --space Favor reduced file size over encryption speed + --speed Favor encryption speed over reduced file size + --tar Create tar archive of directory of files before encryption + +DECRYPTO OPTIONS + --nountar Do not automatically unpack decrypted tar archives + --overwrite | -o Overwrite an existing file with the decrypted file + --stdout | -s Print file contents to the standard output stream + +OTHER OPTIONS + --help | -h Display crypto and decrypto help + --usage Display crypto and decrypto usage + --version | -v Display version number + +DESCRIPTION +Use one or more explicit file path arguments to encrypt or decrypt the file(s). crypto and decrypto will attempt to encrypt or decrypt (respectively) any explicit filepaths that you include irrespective of the file type. Encrypted files are generated on the path '.crypt'. The original file is not modified or removed by crypto. + +Use one or more directory arguments with the crypto executable to encrypt all files in the top level of each directory with the same passphrase. Previously encrypted files with a '.crypt' file type will not be generated again in a directory. Remove them before you run the command if you intend to repeat encryption with a file. + +Use one or more directory arguments with decrypto to decrypt all .crypt, .gpg, .asc, and .pgp files in the top level of each directory. decrypto automatically unpacks decrypted tar archives. + +Encryption is performed with the AES256 cipher algorithm. Decryption will take place with any cipher algorithm that your version of gpg supports. +""" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/METADATA b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/METADATA similarity index 98% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/METADATA rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/METADATA index 90d0c8f9..b64dc49b 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/METADATA +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.0.41 +Version: 1.0.42 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov @@ -18,6 +18,7 @@ Requires-Dist: pillow (>=6.0.0) Requires-Dist: keyboard (>=0.13.3) Requires-Dist: pyautogui (>=0.9.44) Requires-Dist: pywin32 (>=224) +Requires-Dist: crypto (>=1.4.1) # OpenRPA First open source RPA platform for business is released! diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/RECORD similarity index 96% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/RECORD rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/RECORD index 8ecadf9a..dcc1e92d 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/RECORD +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/RECORD @@ -1,8 +1,8 @@ -pyOpenRPA-1.0.41.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pyOpenRPA-1.0.41.dist-info/METADATA,sha256=Yp_YJ3c0_9M4JNzepyJrPqDDp4K4GdCIF98pWtuhLu4,3510 -pyOpenRPA-1.0.41.dist-info/RECORD,, -pyOpenRPA-1.0.41.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 -pyOpenRPA-1.0.41.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 +pyOpenRPA-1.0.42.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyOpenRPA-1.0.42.dist-info/METADATA,sha256=Spesv5ub8aq5ymKhq_1kDDFQ2lrCrTwXfF8PakH7OO8,3542 +pyOpenRPA-1.0.42.dist-info/RECORD,, +pyOpenRPA-1.0.42.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 +pyOpenRPA-1.0.42.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 pyOpenRPA/Orchestrator/Orchestrator.py,sha256=UKp7eqvWDM91kYLwl2mo0UB8Pw-qu8eJCsR9NEXD1aU,6436 pyOpenRPA/Orchestrator/Processor.py,sha256=kmGNIqe6AZMSrzCt1QlonEy58ecFeLunjo8AeRMsufU,11091 pyOpenRPA/Orchestrator/Server.py,sha256=s1ujCuRX6YxRllqPn541Df4pJP7kOexiS3RIuoT4nyE,22053 @@ -265,7 +265,17 @@ pyOpenRPA/Tools/RobotScreenActive/__pycache__/Monitor.cpython-37.pyc,, pyOpenRPA/Tools/RobotScreenActive/__pycache__/Screen.cpython-37.pyc,, pyOpenRPA/Tools/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Tools/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/Crypter.py,sha256=VRrE5-oQxQtvMEPHM1lMXp2CKnceNBmIWJnsJoJkaVE,3616 +pyOpenRPA/Tools/SafeSource/DistrCreate.py,sha256=-_8BTle57LBKVknnB_3af-LghxrRmRGfRNu08CLNIvY,3232 +pyOpenRPA/Tools/SafeSource/DistrRun.py,sha256=TH4uExbufnOubBrTiO8Ccw00E5K6zaJ59-vApSxQ0iY,6661 +pyOpenRPA/Tools/SafeSource/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyOpenRPA/Tools/SafeSource/__main__.py,sha256=g5aYWnuUZoM2jDX2mSIl9tRAJg05tu5VxD2rGJWcACg,649 +pyOpenRPA/Tools/SafeSource/__pycache__/Crypter.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/DistrCreate.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/DistrRun.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/__init__.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/__main__.cpython-37.pyc,, pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,, -pyOpenRPA/__init__.py,sha256=lQ3_677Rja_PqcurcKK5fdhTpkzhXA866JG0Ke-ttxU,175 +pyOpenRPA/__init__.py,sha256=9w2hSRgGrWKyQb3T_j71u7VoYGZsrTZz189nKtqEmOQ,175 pyOpenRPA/__pycache__/__init__.cpython-37.pyc,, diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/WHEEL similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/WHEEL rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/WHEEL diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/top_level.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/top_level.txt similarity index 100% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/top_level.txt rename to Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/top_level.txt diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py new file mode 100644 index 00000000..3921c79b --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py @@ -0,0 +1,79 @@ +import os, random, struct +from Crypto.Cipher import AES + +def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): + """ Шифрует файл используя AES (режим CBC) с + заданным ключом. + + key: + Ключ шифрования - строка длиной + 16, 24 или 32 байта. Более длинные ключи + более безопасны. + + in_filename: + Имя входного файла + + out_filename: + Если None, будет использоваться « .enc». + + chunksize: + Устанавливает размер фрагмента, который функция + использует для чтения и шифрования файла.Большие + размеры могут быть быстрее для некоторых файлов и машин. + кусок (chunk) должен делиться на 16. + """ + if not out_filename: + out_filename = in_filename + '.enc' + iv = ''.join(chr(random.randint(0, 0xFF)) for i in range(16)) + iv = iv.encode('utf8')[0:16] + encryptor = AES.new(key, AES.MODE_CBC, iv) + filesize = os.path.getsize(in_filename) + with open(in_filename, 'rb') as infile: + with open(out_filename, 'wb') as outfile: + outfile.write(struct.pack('>> filename = 'somefile; rm -rf ~' +>>> command = 'ls -l {}'.format(filename) +>>> print(command) # executed by a shell: boom! +ls -l somefile; rm -rf ~ +``` + +`quote()` lets you plug the security hole: + +```python +>>> command = 'ls -l {}'.format(quote(filename)) +>>> print(command) +ls -l 'somefile; rm -rf ~' +>>> remote_command = 'ssh home {}'.format(quote(command)) +>>> print(remote_command) +ssh home 'ls -l '"'"'somefile; rm -rf ~'"'"'' +``` + +The quoting is compatible with UNIX shells and with `shlex.split()`: + +```python +>>> remote_command = split(remote_command) +>>> remote_command +['ssh', 'home', "ls -l 'somefile; rm -rf ~'"] +>>> command = split(remote_command[-1]) +>>> command +['ls', '-l', 'somefile; rm -rf ~'] +``` + + +## Usage + +Include `shellescape` in your project setup.py file `install_requires` dependency definition list: + +```python +setup( + ... + install_requires=['shellescape'], + ... +) +``` + +Then import the `quote` function into your module(s) and use it as needed: + +```python +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from shellescape import quote + +filename = "somefile; rm -rf ~" +escaped_shell_command = 'ls -l {}'.format(quote(filename)) +``` + +## License + +[LICENSE](https://github.com/chrissimpkins/shellescape/blob/master/docs/LICENSE) + + + + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD new file mode 100644 index 00000000..ad2e8667 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD @@ -0,0 +1,11 @@ +shellescape-3.8.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +shellescape-3.8.1.dist-info/METADATA,sha256=0JKCtsUacGFBcPFmQFEXZhf6s6YL1HtvJjUZwwsHwW0,2830 +shellescape-3.8.1.dist-info/RECORD,, +shellescape-3.8.1.dist-info/WHEEL,sha256=8zNYZbwQSXoB9IfXOjPfeNwvAsALAjffgk27FqvCWbo,110 +shellescape-3.8.1.dist-info/top_level.txt,sha256=1nR_M9ikLI5pRQ3rfRuYjdDB9AjP3V9GAQITd5ohg98,12 +shellescape/__init__.py,sha256=J9YVVI_M1jo_ZSqrPd7v379OhwJdfj65HyyrDTIGwAU,71 +shellescape/__pycache__/__init__.cpython-37.pyc,, +shellescape/__pycache__/main.cpython-37.pyc,, +shellescape/__pycache__/settings.cpython-37.pyc,, +shellescape/main.py,sha256=t8Fy42MZOR3BEYyVPAY1ArIbHG_kJANIH7u3XLGm1fE,435 +shellescape/settings.py,sha256=tcr2V8HBzoiMYSqwczFT7HYzKHc6UbR7p7C5Q_LV9T8,494 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL new file mode 100644 index 00000000..8b701e93 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt new file mode 100644 index 00000000..0d98e3a7 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt @@ -0,0 +1 @@ +shellescape diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/__init__.py new file mode 100644 index 00000000..00ba358c --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/__init__.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from .main import quote diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/main.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/main.py new file mode 100644 index 00000000..3409350f --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/main.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + + +_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search + + +def quote(s): + """Return a shell-escaped version of the string *s*.""" + if not s: + return "''" + if _find_unsafe(s) is None: + return s + + # use single quotes, and put single quotes into double quotes + # the string $'b is then quoted as '$'"'"'b' + return "'" + s.replace("'", "'\"'\"'") + "'" diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/settings.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/settings.py new file mode 100644 index 00000000..7600a2f9 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/shellescape/settings.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# Application Name +# ------------------------------------------------------------------------------ +app_name = 'shellescape' + +# ------------------------------------------------------------------------------ +# Version Number +# ------------------------------------------------------------------------------ +major_version = "3" +minor_version = "8" +patch_version = "1" + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/__init__.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/__init__.py new file mode 100644 index 00000000..658a08a6 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/__init__.py @@ -0,0 +1,427 @@ + +from .error import * + +from .tokens import * +from .events import * +from .nodes import * + +from .loader import * +from .dumper import * + +__version__ = '5.3' +try: + from .cyaml import * + __with_libyaml__ = True +except ImportError: + __with_libyaml__ = False + +import io + +#------------------------------------------------------------------------------ +# Warnings control +#------------------------------------------------------------------------------ + +# 'Global' warnings state: +_warnings_enabled = { + 'YAMLLoadWarning': True, +} + +# Get or set global warnings' state +def warnings(settings=None): + if settings is None: + return _warnings_enabled + + if type(settings) is dict: + for key in settings: + if key in _warnings_enabled: + _warnings_enabled[key] = settings[key] + +# Warn when load() is called without Loader=... +class YAMLLoadWarning(RuntimeWarning): + pass + +def load_warning(method): + if _warnings_enabled['YAMLLoadWarning'] is False: + return + + import warnings + + message = ( + "calling yaml.%s() without Loader=... is deprecated, as the " + "default Loader is unsafe. Please read " + "https://msg.pyyaml.org/load for full details." + ) % method + + warnings.warn(message, YAMLLoadWarning, stacklevel=3) + +#------------------------------------------------------------------------------ +def scan(stream, Loader=Loader): + """ + Scan a YAML stream and produce scanning tokens. + """ + loader = Loader(stream) + try: + while loader.check_token(): + yield loader.get_token() + finally: + loader.dispose() + +def parse(stream, Loader=Loader): + """ + Parse a YAML stream and produce parsing events. + """ + loader = Loader(stream) + try: + while loader.check_event(): + yield loader.get_event() + finally: + loader.dispose() + +def compose(stream, Loader=Loader): + """ + Parse the first YAML document in a stream + and produce the corresponding representation tree. + """ + loader = Loader(stream) + try: + return loader.get_single_node() + finally: + loader.dispose() + +def compose_all(stream, Loader=Loader): + """ + Parse all YAML documents in a stream + and produce corresponding representation trees. + """ + loader = Loader(stream) + try: + while loader.check_node(): + yield loader.get_node() + finally: + loader.dispose() + +def load(stream, Loader=None): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + """ + if Loader is None: + load_warning('load') + Loader = FullLoader + + loader = Loader(stream) + try: + return loader.get_single_data() + finally: + loader.dispose() + +def load_all(stream, Loader=None): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + """ + if Loader is None: + load_warning('load_all') + Loader = FullLoader + + loader = Loader(stream) + try: + while loader.check_data(): + yield loader.get_data() + finally: + loader.dispose() + +def full_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve all tags except those known to be + unsafe on untrusted input. + """ + return load(stream, FullLoader) + +def full_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve all tags except those known to be + unsafe on untrusted input. + """ + return load_all(stream, FullLoader) + +def safe_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve only basic YAML tags. This is known + to be safe for untrusted input. + """ + return load(stream, SafeLoader) + +def safe_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve only basic YAML tags. This is known + to be safe for untrusted input. + """ + return load_all(stream, SafeLoader) + +def unsafe_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve all tags, even those known to be + unsafe on untrusted input. + """ + return load(stream, UnsafeLoader) + +def unsafe_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve all tags, even those known to be + unsafe on untrusted input. + """ + return load_all(stream, UnsafeLoader) + +def emit(events, stream=None, Dumper=Dumper, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None): + """ + Emit YAML parsing events into a stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + stream = io.StringIO() + getvalue = stream.getvalue + dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + try: + for event in events: + dumper.emit(event) + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def serialize_all(nodes, stream=None, Dumper=Dumper, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None): + """ + Serialize a sequence of representation trees into a YAML stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() + getvalue = stream.getvalue + dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break, + encoding=encoding, version=version, tags=tags, + explicit_start=explicit_start, explicit_end=explicit_end) + try: + dumper.open() + for node in nodes: + dumper.serialize(node) + dumper.close() + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def serialize(node, stream=None, Dumper=Dumper, **kwds): + """ + Serialize a representation tree into a YAML stream. + If stream is None, return the produced string instead. + """ + return serialize_all([node], stream, Dumper=Dumper, **kwds) + +def dump_all(documents, stream=None, Dumper=Dumper, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + """ + Serialize a sequence of Python objects into a YAML stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() + getvalue = stream.getvalue + dumper = Dumper(stream, default_style=default_style, + default_flow_style=default_flow_style, + canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break, + encoding=encoding, version=version, tags=tags, + explicit_start=explicit_start, explicit_end=explicit_end, sort_keys=sort_keys) + try: + dumper.open() + for data in documents: + dumper.represent(data) + dumper.close() + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def dump(data, stream=None, Dumper=Dumper, **kwds): + """ + Serialize a Python object into a YAML stream. + If stream is None, return the produced string instead. + """ + return dump_all([data], stream, Dumper=Dumper, **kwds) + +def safe_dump_all(documents, stream=None, **kwds): + """ + Serialize a sequence of Python objects into a YAML stream. + Produce only basic YAML tags. + If stream is None, return the produced string instead. + """ + return dump_all(documents, stream, Dumper=SafeDumper, **kwds) + +def safe_dump(data, stream=None, **kwds): + """ + Serialize a Python object into a YAML stream. + Produce only basic YAML tags. + If stream is None, return the produced string instead. + """ + return dump_all([data], stream, Dumper=SafeDumper, **kwds) + +def add_implicit_resolver(tag, regexp, first=None, + Loader=None, Dumper=Dumper): + """ + Add an implicit scalar detector. + If an implicit scalar value matches the given regexp, + the corresponding tag is assigned to the scalar. + first is a sequence of possible initial characters or None. + """ + if Loader is None: + loader.Loader.add_implicit_resolver(tag, regexp, first) + loader.FullLoader.add_implicit_resolver(tag, regexp, first) + loader.UnsafeLoader.add_implicit_resolver(tag, regexp, first) + else: + Loader.add_implicit_resolver(tag, regexp, first) + Dumper.add_implicit_resolver(tag, regexp, first) + +def add_path_resolver(tag, path, kind=None, Loader=None, Dumper=Dumper): + """ + Add a path based resolver for the given tag. + A path is a list of keys that forms a path + to a node in the representation tree. + Keys can be string values, integers, or None. + """ + if Loader is None: + loader.Loader.add_path_resolver(tag, path, kind) + loader.FullLoader.add_path_resolver(tag, path, kind) + loader.UnsafeLoader.add_path_resolver(tag, path, kind) + else: + Loader.add_path_resolver(tag, path, kind) + Dumper.add_path_resolver(tag, path, kind) + +def add_constructor(tag, constructor, Loader=None): + """ + Add a constructor for the given tag. + Constructor is a function that accepts a Loader instance + and a node object and produces the corresponding Python object. + """ + if Loader is None: + loader.Loader.add_constructor(tag, constructor) + loader.FullLoader.add_constructor(tag, constructor) + loader.UnsafeLoader.add_constructor(tag, constructor) + else: + Loader.add_constructor(tag, constructor) + +def add_multi_constructor(tag_prefix, multi_constructor, Loader=None): + """ + Add a multi-constructor for the given tag prefix. + Multi-constructor is called for a node if its tag starts with tag_prefix. + Multi-constructor accepts a Loader instance, a tag suffix, + and a node object and produces the corresponding Python object. + """ + if Loader is None: + loader.Loader.add_multi_constructor(tag_prefix, multi_constructor) + loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor) + loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor) + else: + Loader.add_multi_constructor(tag_prefix, multi_constructor) + +def add_representer(data_type, representer, Dumper=Dumper): + """ + Add a representer for the given type. + Representer is a function accepting a Dumper instance + and an instance of the given data type + and producing the corresponding representation node. + """ + Dumper.add_representer(data_type, representer) + +def add_multi_representer(data_type, multi_representer, Dumper=Dumper): + """ + Add a representer for the given type. + Multi-representer is a function accepting a Dumper instance + and an instance of the given data type or subtype + and producing the corresponding representation node. + """ + Dumper.add_multi_representer(data_type, multi_representer) + +class YAMLObjectMetaclass(type): + """ + The metaclass for YAMLObject. + """ + def __init__(cls, name, bases, kwds): + super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds) + if 'yaml_tag' in kwds and kwds['yaml_tag'] is not None: + if isinstance(cls.yaml_loader, list): + for loader in cls.yaml_loader: + loader.add_constructor(cls.yaml_tag, cls.from_yaml) + else: + cls.yaml_loader.add_constructor(cls.yaml_tag, cls.from_yaml) + + cls.yaml_dumper.add_representer(cls, cls.to_yaml) + +class YAMLObject(metaclass=YAMLObjectMetaclass): + """ + An object that can dump itself to a YAML stream + and load itself from a YAML stream. + """ + + __slots__ = () # no direct instantiation, so allow immutable subclasses + + yaml_loader = [Loader, FullLoader, UnsafeLoader] + yaml_dumper = Dumper + + yaml_tag = None + yaml_flow_style = None + + @classmethod + def from_yaml(cls, loader, node): + """ + Convert a representation node to a Python object. + """ + return loader.construct_yaml_object(node, cls) + + @classmethod + def to_yaml(cls, dumper, data): + """ + Convert a Python object to a representation node. + """ + return dumper.represent_yaml_object(cls.yaml_tag, data, cls, + flow_style=cls.yaml_flow_style) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/composer.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/composer.py new file mode 100644 index 00000000..6d15cb40 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/composer.py @@ -0,0 +1,139 @@ + +__all__ = ['Composer', 'ComposerError'] + +from .error import MarkedYAMLError +from .events import * +from .nodes import * + +class ComposerError(MarkedYAMLError): + pass + +class Composer: + + def __init__(self): + self.anchors = {} + + def check_node(self): + # Drop the STREAM-START event. + if self.check_event(StreamStartEvent): + self.get_event() + + # If there are more documents available? + return not self.check_event(StreamEndEvent) + + def get_node(self): + # Get the root node of the next document. + if not self.check_event(StreamEndEvent): + return self.compose_document() + + def get_single_node(self): + # Drop the STREAM-START event. + self.get_event() + + # Compose a document if the stream is not empty. + document = None + if not self.check_event(StreamEndEvent): + document = self.compose_document() + + # Ensure that the stream contains no more documents. + if not self.check_event(StreamEndEvent): + event = self.get_event() + raise ComposerError("expected a single document in the stream", + document.start_mark, "but found another document", + event.start_mark) + + # Drop the STREAM-END event. + self.get_event() + + return document + + def compose_document(self): + # Drop the DOCUMENT-START event. + self.get_event() + + # Compose the root node. + node = self.compose_node(None, None) + + # Drop the DOCUMENT-END event. + self.get_event() + + self.anchors = {} + return node + + def compose_node(self, parent, index): + if self.check_event(AliasEvent): + event = self.get_event() + anchor = event.anchor + if anchor not in self.anchors: + raise ComposerError(None, None, "found undefined alias %r" + % anchor, event.start_mark) + return self.anchors[anchor] + event = self.peek_event() + anchor = event.anchor + if anchor is not None: + if anchor in self.anchors: + raise ComposerError("found duplicate anchor %r; first occurrence" + % anchor, self.anchors[anchor].start_mark, + "second occurrence", event.start_mark) + self.descend_resolver(parent, index) + if self.check_event(ScalarEvent): + node = self.compose_scalar_node(anchor) + elif self.check_event(SequenceStartEvent): + node = self.compose_sequence_node(anchor) + elif self.check_event(MappingStartEvent): + node = self.compose_mapping_node(anchor) + self.ascend_resolver() + return node + + def compose_scalar_node(self, anchor): + event = self.get_event() + tag = event.tag + if tag is None or tag == '!': + tag = self.resolve(ScalarNode, event.value, event.implicit) + node = ScalarNode(tag, event.value, + event.start_mark, event.end_mark, style=event.style) + if anchor is not None: + self.anchors[anchor] = node + return node + + def compose_sequence_node(self, anchor): + start_event = self.get_event() + tag = start_event.tag + if tag is None or tag == '!': + tag = self.resolve(SequenceNode, None, start_event.implicit) + node = SequenceNode(tag, [], + start_event.start_mark, None, + flow_style=start_event.flow_style) + if anchor is not None: + self.anchors[anchor] = node + index = 0 + while not self.check_event(SequenceEndEvent): + node.value.append(self.compose_node(node, index)) + index += 1 + end_event = self.get_event() + node.end_mark = end_event.end_mark + return node + + def compose_mapping_node(self, anchor): + start_event = self.get_event() + tag = start_event.tag + if tag is None or tag == '!': + tag = self.resolve(MappingNode, None, start_event.implicit) + node = MappingNode(tag, [], + start_event.start_mark, None, + flow_style=start_event.flow_style) + if anchor is not None: + self.anchors[anchor] = node + while not self.check_event(MappingEndEvent): + #key_event = self.peek_event() + item_key = self.compose_node(node, None) + #if item_key in node.value: + # raise ComposerError("while composing a mapping", start_event.start_mark, + # "found duplicate key", key_event.start_mark) + item_value = self.compose_node(node, item_key) + #node.value[item_key] = item_value + node.value.append((item_key, item_value)) + end_event = self.get_event() + node.end_mark = end_event.end_mark + return node + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/constructor.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/constructor.py new file mode 100644 index 00000000..cd9167ea --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/constructor.py @@ -0,0 +1,721 @@ + +__all__ = [ + 'BaseConstructor', + 'SafeConstructor', + 'FullConstructor', + 'UnsafeConstructor', + 'Constructor', + 'ConstructorError' +] + +from .error import * +from .nodes import * + +import collections.abc, datetime, base64, binascii, re, sys, types + +class ConstructorError(MarkedYAMLError): + pass + +class BaseConstructor: + + yaml_constructors = {} + yaml_multi_constructors = {} + + def __init__(self): + self.constructed_objects = {} + self.recursive_objects = {} + self.state_generators = [] + self.deep_construct = False + + def check_data(self): + # If there are more documents available? + return self.check_node() + + def get_data(self): + # Construct and return the next document. + if self.check_node(): + return self.construct_document(self.get_node()) + + def get_single_data(self): + # Ensure that the stream contains a single document and construct it. + node = self.get_single_node() + if node is not None: + return self.construct_document(node) + return None + + def construct_document(self, node): + data = self.construct_object(node) + while self.state_generators: + state_generators = self.state_generators + self.state_generators = [] + for generator in state_generators: + for dummy in generator: + pass + self.constructed_objects = {} + self.recursive_objects = {} + self.deep_construct = False + return data + + def construct_object(self, node, deep=False): + if node in self.constructed_objects: + return self.constructed_objects[node] + if deep: + old_deep = self.deep_construct + self.deep_construct = True + if node in self.recursive_objects: + raise ConstructorError(None, None, + "found unconstructable recursive node", node.start_mark) + self.recursive_objects[node] = None + constructor = None + tag_suffix = None + if node.tag in self.yaml_constructors: + constructor = self.yaml_constructors[node.tag] + else: + for tag_prefix in self.yaml_multi_constructors: + if tag_prefix is not None and node.tag.startswith(tag_prefix): + tag_suffix = node.tag[len(tag_prefix):] + constructor = self.yaml_multi_constructors[tag_prefix] + break + else: + if None in self.yaml_multi_constructors: + tag_suffix = node.tag + constructor = self.yaml_multi_constructors[None] + elif None in self.yaml_constructors: + constructor = self.yaml_constructors[None] + elif isinstance(node, ScalarNode): + constructor = self.__class__.construct_scalar + elif isinstance(node, SequenceNode): + constructor = self.__class__.construct_sequence + elif isinstance(node, MappingNode): + constructor = self.__class__.construct_mapping + if tag_suffix is None: + data = constructor(self, node) + else: + data = constructor(self, tag_suffix, node) + if isinstance(data, types.GeneratorType): + generator = data + data = next(generator) + if self.deep_construct: + for dummy in generator: + pass + else: + self.state_generators.append(generator) + self.constructed_objects[node] = data + del self.recursive_objects[node] + if deep: + self.deep_construct = old_deep + return data + + def construct_scalar(self, node): + if not isinstance(node, ScalarNode): + raise ConstructorError(None, None, + "expected a scalar node, but found %s" % node.id, + node.start_mark) + return node.value + + def construct_sequence(self, node, deep=False): + if not isinstance(node, SequenceNode): + raise ConstructorError(None, None, + "expected a sequence node, but found %s" % node.id, + node.start_mark) + return [self.construct_object(child, deep=deep) + for child in node.value] + + def construct_mapping(self, node, deep=False): + if not isinstance(node, MappingNode): + raise ConstructorError(None, None, + "expected a mapping node, but found %s" % node.id, + node.start_mark) + mapping = {} + for key_node, value_node in node.value: + key = self.construct_object(key_node, deep=deep) + if not isinstance(key, collections.abc.Hashable): + raise ConstructorError("while constructing a mapping", node.start_mark, + "found unhashable key", key_node.start_mark) + value = self.construct_object(value_node, deep=deep) + mapping[key] = value + return mapping + + def construct_pairs(self, node, deep=False): + if not isinstance(node, MappingNode): + raise ConstructorError(None, None, + "expected a mapping node, but found %s" % node.id, + node.start_mark) + pairs = [] + for key_node, value_node in node.value: + key = self.construct_object(key_node, deep=deep) + value = self.construct_object(value_node, deep=deep) + pairs.append((key, value)) + return pairs + + @classmethod + def add_constructor(cls, tag, constructor): + if not 'yaml_constructors' in cls.__dict__: + cls.yaml_constructors = cls.yaml_constructors.copy() + cls.yaml_constructors[tag] = constructor + + @classmethod + def add_multi_constructor(cls, tag_prefix, multi_constructor): + if not 'yaml_multi_constructors' in cls.__dict__: + cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy() + cls.yaml_multi_constructors[tag_prefix] = multi_constructor + +class SafeConstructor(BaseConstructor): + + def construct_scalar(self, node): + if isinstance(node, MappingNode): + for key_node, value_node in node.value: + if key_node.tag == 'tag:yaml.org,2002:value': + return self.construct_scalar(value_node) + return super().construct_scalar(node) + + def flatten_mapping(self, node): + merge = [] + index = 0 + while index < len(node.value): + key_node, value_node = node.value[index] + if key_node.tag == 'tag:yaml.org,2002:merge': + del node.value[index] + if isinstance(value_node, MappingNode): + self.flatten_mapping(value_node) + merge.extend(value_node.value) + elif isinstance(value_node, SequenceNode): + submerge = [] + for subnode in value_node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing a mapping", + node.start_mark, + "expected a mapping for merging, but found %s" + % subnode.id, subnode.start_mark) + self.flatten_mapping(subnode) + submerge.append(subnode.value) + submerge.reverse() + for value in submerge: + merge.extend(value) + else: + raise ConstructorError("while constructing a mapping", node.start_mark, + "expected a mapping or list of mappings for merging, but found %s" + % value_node.id, value_node.start_mark) + elif key_node.tag == 'tag:yaml.org,2002:value': + key_node.tag = 'tag:yaml.org,2002:str' + index += 1 + else: + index += 1 + if merge: + node.value = merge + node.value + + def construct_mapping(self, node, deep=False): + if isinstance(node, MappingNode): + self.flatten_mapping(node) + return super().construct_mapping(node, deep=deep) + + def construct_yaml_null(self, node): + self.construct_scalar(node) + return None + + bool_values = { + 'yes': True, + 'no': False, + 'true': True, + 'false': False, + 'on': True, + 'off': False, + } + + def construct_yaml_bool(self, node): + value = self.construct_scalar(node) + return self.bool_values[value.lower()] + + def construct_yaml_int(self, node): + value = self.construct_scalar(node) + value = value.replace('_', '') + sign = +1 + if value[0] == '-': + sign = -1 + if value[0] in '+-': + value = value[1:] + if value == '0': + return 0 + elif value.startswith('0b'): + return sign*int(value[2:], 2) + elif value.startswith('0x'): + return sign*int(value[2:], 16) + elif value[0] == '0': + return sign*int(value, 8) + elif ':' in value: + digits = [int(part) for part in value.split(':')] + digits.reverse() + base = 1 + value = 0 + for digit in digits: + value += digit*base + base *= 60 + return sign*value + else: + return sign*int(value) + + inf_value = 1e300 + while inf_value != inf_value*inf_value: + inf_value *= inf_value + nan_value = -inf_value/inf_value # Trying to make a quiet NaN (like C99). + + def construct_yaml_float(self, node): + value = self.construct_scalar(node) + value = value.replace('_', '').lower() + sign = +1 + if value[0] == '-': + sign = -1 + if value[0] in '+-': + value = value[1:] + if value == '.inf': + return sign*self.inf_value + elif value == '.nan': + return self.nan_value + elif ':' in value: + digits = [float(part) for part in value.split(':')] + digits.reverse() + base = 1 + value = 0.0 + for digit in digits: + value += digit*base + base *= 60 + return sign*value + else: + return sign*float(value) + + def construct_yaml_binary(self, node): + try: + value = self.construct_scalar(node).encode('ascii') + except UnicodeEncodeError as exc: + raise ConstructorError(None, None, + "failed to convert base64 data into ascii: %s" % exc, + node.start_mark) + try: + if hasattr(base64, 'decodebytes'): + return base64.decodebytes(value) + else: + return base64.decodestring(value) + except binascii.Error as exc: + raise ConstructorError(None, None, + "failed to decode base64 data: %s" % exc, node.start_mark) + + timestamp_regexp = re.compile( + r'''^(?P[0-9][0-9][0-9][0-9]) + -(?P[0-9][0-9]?) + -(?P[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P[0-9][0-9]?) + :(?P[0-9][0-9]) + :(?P[0-9][0-9]) + (?:\.(?P[0-9]*))? + (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) + (?::(?P[0-9][0-9]))?))?)?$''', re.X) + + def construct_yaml_timestamp(self, node): + value = self.construct_scalar(node) + match = self.timestamp_regexp.match(node.value) + values = match.groupdict() + year = int(values['year']) + month = int(values['month']) + day = int(values['day']) + if not values['hour']: + return datetime.date(year, month, day) + hour = int(values['hour']) + minute = int(values['minute']) + second = int(values['second']) + fraction = 0 + tzinfo = None + if values['fraction']: + fraction = values['fraction'][:6] + while len(fraction) < 6: + fraction += '0' + fraction = int(fraction) + if values['tz_sign']: + tz_hour = int(values['tz_hour']) + tz_minute = int(values['tz_minute'] or 0) + delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute) + if values['tz_sign'] == '-': + delta = -delta + tzinfo = datetime.timezone(delta) + elif values['tz']: + tzinfo = datetime.timezone.utc + return datetime.datetime(year, month, day, hour, minute, second, fraction, + tzinfo=tzinfo) + + def construct_yaml_omap(self, node): + # Note: we do not check for duplicate keys, because it's too + # CPU-expensive. + omap = [] + yield omap + if not isinstance(node, SequenceNode): + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a sequence, but found %s" % node.id, node.start_mark) + for subnode in node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a mapping of length 1, but found %s" % subnode.id, + subnode.start_mark) + if len(subnode.value) != 1: + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a single mapping item, but found %d items" % len(subnode.value), + subnode.start_mark) + key_node, value_node = subnode.value[0] + key = self.construct_object(key_node) + value = self.construct_object(value_node) + omap.append((key, value)) + + def construct_yaml_pairs(self, node): + # Note: the same code as `construct_yaml_omap`. + pairs = [] + yield pairs + if not isinstance(node, SequenceNode): + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a sequence, but found %s" % node.id, node.start_mark) + for subnode in node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a mapping of length 1, but found %s" % subnode.id, + subnode.start_mark) + if len(subnode.value) != 1: + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a single mapping item, but found %d items" % len(subnode.value), + subnode.start_mark) + key_node, value_node = subnode.value[0] + key = self.construct_object(key_node) + value = self.construct_object(value_node) + pairs.append((key, value)) + + def construct_yaml_set(self, node): + data = set() + yield data + value = self.construct_mapping(node) + data.update(value) + + def construct_yaml_str(self, node): + return self.construct_scalar(node) + + def construct_yaml_seq(self, node): + data = [] + yield data + data.extend(self.construct_sequence(node)) + + def construct_yaml_map(self, node): + data = {} + yield data + value = self.construct_mapping(node) + data.update(value) + + def construct_yaml_object(self, node, cls): + data = cls.__new__(cls) + yield data + if hasattr(data, '__setstate__'): + state = self.construct_mapping(node, deep=True) + data.__setstate__(state) + else: + state = self.construct_mapping(node) + data.__dict__.update(state) + + def construct_undefined(self, node): + raise ConstructorError(None, None, + "could not determine a constructor for the tag %r" % node.tag, + node.start_mark) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:null', + SafeConstructor.construct_yaml_null) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:bool', + SafeConstructor.construct_yaml_bool) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:int', + SafeConstructor.construct_yaml_int) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:float', + SafeConstructor.construct_yaml_float) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:binary', + SafeConstructor.construct_yaml_binary) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:timestamp', + SafeConstructor.construct_yaml_timestamp) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:omap', + SafeConstructor.construct_yaml_omap) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:pairs', + SafeConstructor.construct_yaml_pairs) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:set', + SafeConstructor.construct_yaml_set) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:str', + SafeConstructor.construct_yaml_str) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:seq', + SafeConstructor.construct_yaml_seq) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:map', + SafeConstructor.construct_yaml_map) + +SafeConstructor.add_constructor(None, + SafeConstructor.construct_undefined) + +class FullConstructor(SafeConstructor): + + def construct_python_str(self, node): + return self.construct_scalar(node) + + def construct_python_unicode(self, node): + return self.construct_scalar(node) + + def construct_python_bytes(self, node): + try: + value = self.construct_scalar(node).encode('ascii') + except UnicodeEncodeError as exc: + raise ConstructorError(None, None, + "failed to convert base64 data into ascii: %s" % exc, + node.start_mark) + try: + if hasattr(base64, 'decodebytes'): + return base64.decodebytes(value) + else: + return base64.decodestring(value) + except binascii.Error as exc: + raise ConstructorError(None, None, + "failed to decode base64 data: %s" % exc, node.start_mark) + + def construct_python_long(self, node): + return self.construct_yaml_int(node) + + def construct_python_complex(self, node): + return complex(self.construct_scalar(node)) + + def construct_python_tuple(self, node): + return tuple(self.construct_sequence(node)) + + def find_python_module(self, name, mark, unsafe=False): + if not name: + raise ConstructorError("while constructing a Python module", mark, + "expected non-empty name appended to the tag", mark) + if unsafe: + try: + __import__(name) + except ImportError as exc: + raise ConstructorError("while constructing a Python module", mark, + "cannot find module %r (%s)" % (name, exc), mark) + if name not in sys.modules: + raise ConstructorError("while constructing a Python module", mark, + "module %r is not imported" % name, mark) + return sys.modules[name] + + def find_python_name(self, name, mark, unsafe=False): + if not name: + raise ConstructorError("while constructing a Python object", mark, + "expected non-empty name appended to the tag", mark) + if '.' in name: + module_name, object_name = name.rsplit('.', 1) + else: + module_name = 'builtins' + object_name = name + if unsafe: + try: + __import__(module_name) + except ImportError as exc: + raise ConstructorError("while constructing a Python object", mark, + "cannot find module %r (%s)" % (module_name, exc), mark) + if module_name not in sys.modules: + raise ConstructorError("while constructing a Python object", mark, + "module %r is not imported" % module_name, mark) + module = sys.modules[module_name] + if not hasattr(module, object_name): + raise ConstructorError("while constructing a Python object", mark, + "cannot find %r in the module %r" + % (object_name, module.__name__), mark) + return getattr(module, object_name) + + def construct_python_name(self, suffix, node): + value = self.construct_scalar(node) + if value: + raise ConstructorError("while constructing a Python name", node.start_mark, + "expected the empty value, but found %r" % value, node.start_mark) + return self.find_python_name(suffix, node.start_mark) + + def construct_python_module(self, suffix, node): + value = self.construct_scalar(node) + if value: + raise ConstructorError("while constructing a Python module", node.start_mark, + "expected the empty value, but found %r" % value, node.start_mark) + return self.find_python_module(suffix, node.start_mark) + + def make_python_instance(self, suffix, node, + args=None, kwds=None, newobj=False, unsafe=False): + if not args: + args = [] + if not kwds: + kwds = {} + cls = self.find_python_name(suffix, node.start_mark) + if not (unsafe or isinstance(cls, type)): + raise ConstructorError("while constructing a Python instance", node.start_mark, + "expected a class, but found %r" % type(cls), + node.start_mark) + if newobj and isinstance(cls, type): + return cls.__new__(cls, *args, **kwds) + else: + return cls(*args, **kwds) + + def set_python_instance_state(self, instance, state): + if hasattr(instance, '__setstate__'): + instance.__setstate__(state) + else: + slotstate = {} + if isinstance(state, tuple) and len(state) == 2: + state, slotstate = state + if hasattr(instance, '__dict__'): + instance.__dict__.update(state) + elif state: + slotstate.update(state) + for key, value in slotstate.items(): + setattr(instance, key, value) + + def construct_python_object(self, suffix, node): + # Format: + # !!python/object:module.name { ... state ... } + instance = self.make_python_instance(suffix, node, newobj=True) + yield instance + deep = hasattr(instance, '__setstate__') + state = self.construct_mapping(node, deep=deep) + self.set_python_instance_state(instance, state) + + def construct_python_object_apply(self, suffix, node, newobj=False): + # Format: + # !!python/object/apply # (or !!python/object/new) + # args: [ ... arguments ... ] + # kwds: { ... keywords ... } + # state: ... state ... + # listitems: [ ... listitems ... ] + # dictitems: { ... dictitems ... } + # or short format: + # !!python/object/apply [ ... arguments ... ] + # The difference between !!python/object/apply and !!python/object/new + # is how an object is created, check make_python_instance for details. + if isinstance(node, SequenceNode): + args = self.construct_sequence(node, deep=True) + kwds = {} + state = {} + listitems = [] + dictitems = {} + else: + value = self.construct_mapping(node, deep=True) + args = value.get('args', []) + kwds = value.get('kwds', {}) + state = value.get('state', {}) + listitems = value.get('listitems', []) + dictitems = value.get('dictitems', {}) + instance = self.make_python_instance(suffix, node, args, kwds, newobj) + if state: + self.set_python_instance_state(instance, state) + if listitems: + instance.extend(listitems) + if dictitems: + for key in dictitems: + instance[key] = dictitems[key] + return instance + + def construct_python_object_new(self, suffix, node): + return self.construct_python_object_apply(suffix, node, newobj=True) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/none', + FullConstructor.construct_yaml_null) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/bool', + FullConstructor.construct_yaml_bool) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/str', + FullConstructor.construct_python_str) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/unicode', + FullConstructor.construct_python_unicode) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/bytes', + FullConstructor.construct_python_bytes) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/int', + FullConstructor.construct_yaml_int) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/long', + FullConstructor.construct_python_long) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/float', + FullConstructor.construct_yaml_float) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/complex', + FullConstructor.construct_python_complex) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/list', + FullConstructor.construct_yaml_seq) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/tuple', + FullConstructor.construct_python_tuple) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/dict', + FullConstructor.construct_yaml_map) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/name:', + FullConstructor.construct_python_name) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/module:', + FullConstructor.construct_python_module) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object:', + FullConstructor.construct_python_object) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object/new:', + FullConstructor.construct_python_object_new) + +class UnsafeConstructor(FullConstructor): + + def find_python_module(self, name, mark): + return super(UnsafeConstructor, self).find_python_module(name, mark, unsafe=True) + + def find_python_name(self, name, mark): + return super(UnsafeConstructor, self).find_python_name(name, mark, unsafe=True) + + def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False): + return super(UnsafeConstructor, self).make_python_instance( + suffix, node, args, kwds, newobj, unsafe=True) + +UnsafeConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object/apply:', + UnsafeConstructor.construct_python_object_apply) + +# Constructor is same as UnsafeConstructor. Need to leave this in place in case +# people have extended it directly. +class Constructor(UnsafeConstructor): + pass diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/cyaml.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/cyaml.py new file mode 100644 index 00000000..1e606c74 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/cyaml.py @@ -0,0 +1,101 @@ + +__all__ = [ + 'CBaseLoader', 'CSafeLoader', 'CFullLoader', 'CUnsafeLoader', 'CLoader', + 'CBaseDumper', 'CSafeDumper', 'CDumper' +] + +from _yaml import CParser, CEmitter + +from .constructor import * + +from .serializer import * +from .representer import * + +from .resolver import * + +class CBaseLoader(CParser, BaseConstructor, BaseResolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class CSafeLoader(CParser, SafeConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class CFullLoader(CParser, FullConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class CUnsafeLoader(CParser, UnsafeConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + UnsafeConstructor.__init__(self) + Resolver.__init__(self) + +class CLoader(CParser, Constructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + Constructor.__init__(self) + Resolver.__init__(self) + +class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class CSafeDumper(CEmitter, SafeRepresenter, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + SafeRepresenter.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class CDumper(CEmitter, Serializer, Representer, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/dumper.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/dumper.py new file mode 100644 index 00000000..6aadba55 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/dumper.py @@ -0,0 +1,62 @@ + +__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] + +from .emitter import * +from .serializer import * +from .representer import * +from .resolver import * + +class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + SafeRepresenter.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class Dumper(Emitter, Serializer, Representer, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/emitter.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/emitter.py new file mode 100644 index 00000000..a664d011 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/emitter.py @@ -0,0 +1,1137 @@ + +# Emitter expects events obeying the following grammar: +# stream ::= STREAM-START document* STREAM-END +# document ::= DOCUMENT-START node DOCUMENT-END +# node ::= SCALAR | sequence | mapping +# sequence ::= SEQUENCE-START node* SEQUENCE-END +# mapping ::= MAPPING-START (node node)* MAPPING-END + +__all__ = ['Emitter', 'EmitterError'] + +from .error import YAMLError +from .events import * + +class EmitterError(YAMLError): + pass + +class ScalarAnalysis: + def __init__(self, scalar, empty, multiline, + allow_flow_plain, allow_block_plain, + allow_single_quoted, allow_double_quoted, + allow_block): + self.scalar = scalar + self.empty = empty + self.multiline = multiline + self.allow_flow_plain = allow_flow_plain + self.allow_block_plain = allow_block_plain + self.allow_single_quoted = allow_single_quoted + self.allow_double_quoted = allow_double_quoted + self.allow_block = allow_block + +class Emitter: + + DEFAULT_TAG_PREFIXES = { + '!' : '!', + 'tag:yaml.org,2002:' : '!!', + } + + def __init__(self, stream, canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None): + + # The stream should have the methods `write` and possibly `flush`. + self.stream = stream + + # Encoding can be overridden by STREAM-START. + self.encoding = None + + # Emitter is a state machine with a stack of states to handle nested + # structures. + self.states = [] + self.state = self.expect_stream_start + + # Current event and the event queue. + self.events = [] + self.event = None + + # The current indentation level and the stack of previous indents. + self.indents = [] + self.indent = None + + # Flow level. + self.flow_level = 0 + + # Contexts. + self.root_context = False + self.sequence_context = False + self.mapping_context = False + self.simple_key_context = False + + # Characteristics of the last emitted character: + # - current position. + # - is it a whitespace? + # - is it an indention character + # (indentation space, '-', '?', or ':')? + self.line = 0 + self.column = 0 + self.whitespace = True + self.indention = True + + # Whether the document requires an explicit document indicator + self.open_ended = False + + # Formatting details. + self.canonical = canonical + self.allow_unicode = allow_unicode + self.best_indent = 2 + if indent and 1 < indent < 10: + self.best_indent = indent + self.best_width = 80 + if width and width > self.best_indent*2: + self.best_width = width + self.best_line_break = '\n' + if line_break in ['\r', '\n', '\r\n']: + self.best_line_break = line_break + + # Tag prefixes. + self.tag_prefixes = None + + # Prepared anchor and tag. + self.prepared_anchor = None + self.prepared_tag = None + + # Scalar analysis and style. + self.analysis = None + self.style = None + + def dispose(self): + # Reset the state attributes (to clear self-references) + self.states = [] + self.state = None + + def emit(self, event): + self.events.append(event) + while not self.need_more_events(): + self.event = self.events.pop(0) + self.state() + self.event = None + + # In some cases, we wait for a few next events before emitting. + + def need_more_events(self): + if not self.events: + return True + event = self.events[0] + if isinstance(event, DocumentStartEvent): + return self.need_events(1) + elif isinstance(event, SequenceStartEvent): + return self.need_events(2) + elif isinstance(event, MappingStartEvent): + return self.need_events(3) + else: + return False + + def need_events(self, count): + level = 0 + for event in self.events[1:]: + if isinstance(event, (DocumentStartEvent, CollectionStartEvent)): + level += 1 + elif isinstance(event, (DocumentEndEvent, CollectionEndEvent)): + level -= 1 + elif isinstance(event, StreamEndEvent): + level = -1 + if level < 0: + return False + return (len(self.events) < count+1) + + def increase_indent(self, flow=False, indentless=False): + self.indents.append(self.indent) + if self.indent is None: + if flow: + self.indent = self.best_indent + else: + self.indent = 0 + elif not indentless: + self.indent += self.best_indent + + # States. + + # Stream handlers. + + def expect_stream_start(self): + if isinstance(self.event, StreamStartEvent): + if self.event.encoding and not hasattr(self.stream, 'encoding'): + self.encoding = self.event.encoding + self.write_stream_start() + self.state = self.expect_first_document_start + else: + raise EmitterError("expected StreamStartEvent, but got %s" + % self.event) + + def expect_nothing(self): + raise EmitterError("expected nothing, but got %s" % self.event) + + # Document handlers. + + def expect_first_document_start(self): + return self.expect_document_start(first=True) + + def expect_document_start(self, first=False): + if isinstance(self.event, DocumentStartEvent): + if (self.event.version or self.event.tags) and self.open_ended: + self.write_indicator('...', True) + self.write_indent() + if self.event.version: + version_text = self.prepare_version(self.event.version) + self.write_version_directive(version_text) + self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy() + if self.event.tags: + handles = sorted(self.event.tags.keys()) + for handle in handles: + prefix = self.event.tags[handle] + self.tag_prefixes[prefix] = handle + handle_text = self.prepare_tag_handle(handle) + prefix_text = self.prepare_tag_prefix(prefix) + self.write_tag_directive(handle_text, prefix_text) + implicit = (first and not self.event.explicit and not self.canonical + and not self.event.version and not self.event.tags + and not self.check_empty_document()) + if not implicit: + self.write_indent() + self.write_indicator('---', True) + if self.canonical: + self.write_indent() + self.state = self.expect_document_root + elif isinstance(self.event, StreamEndEvent): + if self.open_ended: + self.write_indicator('...', True) + self.write_indent() + self.write_stream_end() + self.state = self.expect_nothing + else: + raise EmitterError("expected DocumentStartEvent, but got %s" + % self.event) + + def expect_document_end(self): + if isinstance(self.event, DocumentEndEvent): + self.write_indent() + if self.event.explicit: + self.write_indicator('...', True) + self.write_indent() + self.flush_stream() + self.state = self.expect_document_start + else: + raise EmitterError("expected DocumentEndEvent, but got %s" + % self.event) + + def expect_document_root(self): + self.states.append(self.expect_document_end) + self.expect_node(root=True) + + # Node handlers. + + def expect_node(self, root=False, sequence=False, mapping=False, + simple_key=False): + self.root_context = root + self.sequence_context = sequence + self.mapping_context = mapping + self.simple_key_context = simple_key + if isinstance(self.event, AliasEvent): + self.expect_alias() + elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)): + self.process_anchor('&') + self.process_tag() + if isinstance(self.event, ScalarEvent): + self.expect_scalar() + elif isinstance(self.event, SequenceStartEvent): + if self.flow_level or self.canonical or self.event.flow_style \ + or self.check_empty_sequence(): + self.expect_flow_sequence() + else: + self.expect_block_sequence() + elif isinstance(self.event, MappingStartEvent): + if self.flow_level or self.canonical or self.event.flow_style \ + or self.check_empty_mapping(): + self.expect_flow_mapping() + else: + self.expect_block_mapping() + else: + raise EmitterError("expected NodeEvent, but got %s" % self.event) + + def expect_alias(self): + if self.event.anchor is None: + raise EmitterError("anchor is not specified for alias") + self.process_anchor('*') + self.state = self.states.pop() + + def expect_scalar(self): + self.increase_indent(flow=True) + self.process_scalar() + self.indent = self.indents.pop() + self.state = self.states.pop() + + # Flow sequence handlers. + + def expect_flow_sequence(self): + self.write_indicator('[', True, whitespace=True) + self.flow_level += 1 + self.increase_indent(flow=True) + self.state = self.expect_first_flow_sequence_item + + def expect_first_flow_sequence_item(self): + if isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + self.write_indicator(']', False) + self.state = self.states.pop() + else: + if self.canonical or self.column > self.best_width: + self.write_indent() + self.states.append(self.expect_flow_sequence_item) + self.expect_node(sequence=True) + + def expect_flow_sequence_item(self): + if isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + if self.canonical: + self.write_indicator(',', False) + self.write_indent() + self.write_indicator(']', False) + self.state = self.states.pop() + else: + self.write_indicator(',', False) + if self.canonical or self.column > self.best_width: + self.write_indent() + self.states.append(self.expect_flow_sequence_item) + self.expect_node(sequence=True) + + # Flow mapping handlers. + + def expect_flow_mapping(self): + self.write_indicator('{', True, whitespace=True) + self.flow_level += 1 + self.increase_indent(flow=True) + self.state = self.expect_first_flow_mapping_key + + def expect_first_flow_mapping_key(self): + if isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + self.write_indicator('}', False) + self.state = self.states.pop() + else: + if self.canonical or self.column > self.best_width: + self.write_indent() + if not self.canonical and self.check_simple_key(): + self.states.append(self.expect_flow_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True) + self.states.append(self.expect_flow_mapping_value) + self.expect_node(mapping=True) + + def expect_flow_mapping_key(self): + if isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + if self.canonical: + self.write_indicator(',', False) + self.write_indent() + self.write_indicator('}', False) + self.state = self.states.pop() + else: + self.write_indicator(',', False) + if self.canonical or self.column > self.best_width: + self.write_indent() + if not self.canonical and self.check_simple_key(): + self.states.append(self.expect_flow_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True) + self.states.append(self.expect_flow_mapping_value) + self.expect_node(mapping=True) + + def expect_flow_mapping_simple_value(self): + self.write_indicator(':', False) + self.states.append(self.expect_flow_mapping_key) + self.expect_node(mapping=True) + + def expect_flow_mapping_value(self): + if self.canonical or self.column > self.best_width: + self.write_indent() + self.write_indicator(':', True) + self.states.append(self.expect_flow_mapping_key) + self.expect_node(mapping=True) + + # Block sequence handlers. + + def expect_block_sequence(self): + indentless = (self.mapping_context and not self.indention) + self.increase_indent(flow=False, indentless=indentless) + self.state = self.expect_first_block_sequence_item + + def expect_first_block_sequence_item(self): + return self.expect_block_sequence_item(first=True) + + def expect_block_sequence_item(self, first=False): + if not first and isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.state = self.states.pop() + else: + self.write_indent() + self.write_indicator('-', True, indention=True) + self.states.append(self.expect_block_sequence_item) + self.expect_node(sequence=True) + + # Block mapping handlers. + + def expect_block_mapping(self): + self.increase_indent(flow=False) + self.state = self.expect_first_block_mapping_key + + def expect_first_block_mapping_key(self): + return self.expect_block_mapping_key(first=True) + + def expect_block_mapping_key(self, first=False): + if not first and isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.state = self.states.pop() + else: + self.write_indent() + if self.check_simple_key(): + self.states.append(self.expect_block_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True, indention=True) + self.states.append(self.expect_block_mapping_value) + self.expect_node(mapping=True) + + def expect_block_mapping_simple_value(self): + self.write_indicator(':', False) + self.states.append(self.expect_block_mapping_key) + self.expect_node(mapping=True) + + def expect_block_mapping_value(self): + self.write_indent() + self.write_indicator(':', True, indention=True) + self.states.append(self.expect_block_mapping_key) + self.expect_node(mapping=True) + + # Checkers. + + def check_empty_sequence(self): + return (isinstance(self.event, SequenceStartEvent) and self.events + and isinstance(self.events[0], SequenceEndEvent)) + + def check_empty_mapping(self): + return (isinstance(self.event, MappingStartEvent) and self.events + and isinstance(self.events[0], MappingEndEvent)) + + def check_empty_document(self): + if not isinstance(self.event, DocumentStartEvent) or not self.events: + return False + event = self.events[0] + return (isinstance(event, ScalarEvent) and event.anchor is None + and event.tag is None and event.implicit and event.value == '') + + def check_simple_key(self): + length = 0 + if isinstance(self.event, NodeEvent) and self.event.anchor is not None: + if self.prepared_anchor is None: + self.prepared_anchor = self.prepare_anchor(self.event.anchor) + length += len(self.prepared_anchor) + if isinstance(self.event, (ScalarEvent, CollectionStartEvent)) \ + and self.event.tag is not None: + if self.prepared_tag is None: + self.prepared_tag = self.prepare_tag(self.event.tag) + length += len(self.prepared_tag) + if isinstance(self.event, ScalarEvent): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + length += len(self.analysis.scalar) + return (length < 128 and (isinstance(self.event, AliasEvent) + or (isinstance(self.event, ScalarEvent) + and not self.analysis.empty and not self.analysis.multiline) + or self.check_empty_sequence() or self.check_empty_mapping())) + + # Anchor, Tag, and Scalar processors. + + def process_anchor(self, indicator): + if self.event.anchor is None: + self.prepared_anchor = None + return + if self.prepared_anchor is None: + self.prepared_anchor = self.prepare_anchor(self.event.anchor) + if self.prepared_anchor: + self.write_indicator(indicator+self.prepared_anchor, True) + self.prepared_anchor = None + + def process_tag(self): + tag = self.event.tag + if isinstance(self.event, ScalarEvent): + if self.style is None: + self.style = self.choose_scalar_style() + if ((not self.canonical or tag is None) and + ((self.style == '' and self.event.implicit[0]) + or (self.style != '' and self.event.implicit[1]))): + self.prepared_tag = None + return + if self.event.implicit[0] and tag is None: + tag = '!' + self.prepared_tag = None + else: + if (not self.canonical or tag is None) and self.event.implicit: + self.prepared_tag = None + return + if tag is None: + raise EmitterError("tag is not specified") + if self.prepared_tag is None: + self.prepared_tag = self.prepare_tag(tag) + if self.prepared_tag: + self.write_indicator(self.prepared_tag, True) + self.prepared_tag = None + + def choose_scalar_style(self): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + if self.event.style == '"' or self.canonical: + return '"' + if not self.event.style and self.event.implicit[0]: + if (not (self.simple_key_context and + (self.analysis.empty or self.analysis.multiline)) + and (self.flow_level and self.analysis.allow_flow_plain + or (not self.flow_level and self.analysis.allow_block_plain))): + return '' + if self.event.style and self.event.style in '|>': + if (not self.flow_level and not self.simple_key_context + and self.analysis.allow_block): + return self.event.style + if not self.event.style or self.event.style == '\'': + if (self.analysis.allow_single_quoted and + not (self.simple_key_context and self.analysis.multiline)): + return '\'' + return '"' + + def process_scalar(self): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + if self.style is None: + self.style = self.choose_scalar_style() + split = (not self.simple_key_context) + #if self.analysis.multiline and split \ + # and (not self.style or self.style in '\'\"'): + # self.write_indent() + if self.style == '"': + self.write_double_quoted(self.analysis.scalar, split) + elif self.style == '\'': + self.write_single_quoted(self.analysis.scalar, split) + elif self.style == '>': + self.write_folded(self.analysis.scalar) + elif self.style == '|': + self.write_literal(self.analysis.scalar) + else: + self.write_plain(self.analysis.scalar, split) + self.analysis = None + self.style = None + + # Analyzers. + + def prepare_version(self, version): + major, minor = version + if major != 1: + raise EmitterError("unsupported YAML version: %d.%d" % (major, minor)) + return '%d.%d' % (major, minor) + + def prepare_tag_handle(self, handle): + if not handle: + raise EmitterError("tag handle must not be empty") + if handle[0] != '!' or handle[-1] != '!': + raise EmitterError("tag handle must start and end with '!': %r" % handle) + for ch in handle[1:-1]: + if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_'): + raise EmitterError("invalid character %r in the tag handle: %r" + % (ch, handle)) + return handle + + def prepare_tag_prefix(self, prefix): + if not prefix: + raise EmitterError("tag prefix must not be empty") + chunks = [] + start = end = 0 + if prefix[0] == '!': + end = 1 + while end < len(prefix): + ch = prefix[end] + if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?!:@&=+$,_.~*\'()[]': + end += 1 + else: + if start < end: + chunks.append(prefix[start:end]) + start = end = end+1 + data = ch.encode('utf-8') + for ch in data: + chunks.append('%%%02X' % ord(ch)) + if start < end: + chunks.append(prefix[start:end]) + return ''.join(chunks) + + def prepare_tag(self, tag): + if not tag: + raise EmitterError("tag must not be empty") + if tag == '!': + return tag + handle = None + suffix = tag + prefixes = sorted(self.tag_prefixes.keys()) + for prefix in prefixes: + if tag.startswith(prefix) \ + and (prefix == '!' or len(prefix) < len(tag)): + handle = self.tag_prefixes[prefix] + suffix = tag[len(prefix):] + chunks = [] + start = end = 0 + while end < len(suffix): + ch = suffix[end] + if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?:@&=+$,_.~*\'()[]' \ + or (ch == '!' and handle != '!'): + end += 1 + else: + if start < end: + chunks.append(suffix[start:end]) + start = end = end+1 + data = ch.encode('utf-8') + for ch in data: + chunks.append('%%%02X' % ch) + if start < end: + chunks.append(suffix[start:end]) + suffix_text = ''.join(chunks) + if handle: + return '%s%s' % (handle, suffix_text) + else: + return '!<%s>' % suffix_text + + def prepare_anchor(self, anchor): + if not anchor: + raise EmitterError("anchor must not be empty") + for ch in anchor: + if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_'): + raise EmitterError("invalid character %r in the anchor: %r" + % (ch, anchor)) + return anchor + + def analyze_scalar(self, scalar): + + # Empty scalar is a special case. + if not scalar: + return ScalarAnalysis(scalar=scalar, empty=True, multiline=False, + allow_flow_plain=False, allow_block_plain=True, + allow_single_quoted=True, allow_double_quoted=True, + allow_block=False) + + # Indicators and special characters. + block_indicators = False + flow_indicators = False + line_breaks = False + special_characters = False + + # Important whitespace combinations. + leading_space = False + leading_break = False + trailing_space = False + trailing_break = False + break_space = False + space_break = False + + # Check document indicators. + if scalar.startswith('---') or scalar.startswith('...'): + block_indicators = True + flow_indicators = True + + # First character or preceded by a whitespace. + preceded_by_whitespace = True + + # Last character or followed by a whitespace. + followed_by_whitespace = (len(scalar) == 1 or + scalar[1] in '\0 \t\r\n\x85\u2028\u2029') + + # The previous character is a space. + previous_space = False + + # The previous character is a break. + previous_break = False + + index = 0 + while index < len(scalar): + ch = scalar[index] + + # Check for indicators. + if index == 0: + # Leading indicators are special characters. + if ch in '#,[]{}&*!|>\'\"%@`': + flow_indicators = True + block_indicators = True + if ch in '?:': + flow_indicators = True + if followed_by_whitespace: + block_indicators = True + if ch == '-' and followed_by_whitespace: + flow_indicators = True + block_indicators = True + else: + # Some indicators cannot appear within a scalar as well. + if ch in ',?[]{}': + flow_indicators = True + if ch == ':': + flow_indicators = True + if followed_by_whitespace: + block_indicators = True + if ch == '#' and preceded_by_whitespace: + flow_indicators = True + block_indicators = True + + # Check for line breaks, special, and unicode characters. + if ch in '\n\x85\u2028\u2029': + line_breaks = True + if not (ch == '\n' or '\x20' <= ch <= '\x7E'): + if (ch == '\x85' or '\xA0' <= ch <= '\uD7FF' + or '\uE000' <= ch <= '\uFFFD' + or '\U00010000' <= ch < '\U0010ffff') and ch != '\uFEFF': + unicode_characters = True + if not self.allow_unicode: + special_characters = True + else: + special_characters = True + + # Detect important whitespace combinations. + if ch == ' ': + if index == 0: + leading_space = True + if index == len(scalar)-1: + trailing_space = True + if previous_break: + break_space = True + previous_space = True + previous_break = False + elif ch in '\n\x85\u2028\u2029': + if index == 0: + leading_break = True + if index == len(scalar)-1: + trailing_break = True + if previous_space: + space_break = True + previous_space = False + previous_break = True + else: + previous_space = False + previous_break = False + + # Prepare for the next character. + index += 1 + preceded_by_whitespace = (ch in '\0 \t\r\n\x85\u2028\u2029') + followed_by_whitespace = (index+1 >= len(scalar) or + scalar[index+1] in '\0 \t\r\n\x85\u2028\u2029') + + # Let's decide what styles are allowed. + allow_flow_plain = True + allow_block_plain = True + allow_single_quoted = True + allow_double_quoted = True + allow_block = True + + # Leading and trailing whitespaces are bad for plain scalars. + if (leading_space or leading_break + or trailing_space or trailing_break): + allow_flow_plain = allow_block_plain = False + + # We do not permit trailing spaces for block scalars. + if trailing_space: + allow_block = False + + # Spaces at the beginning of a new line are only acceptable for block + # scalars. + if break_space: + allow_flow_plain = allow_block_plain = allow_single_quoted = False + + # Spaces followed by breaks, as well as special character are only + # allowed for double quoted scalars. + if space_break or special_characters: + allow_flow_plain = allow_block_plain = \ + allow_single_quoted = allow_block = False + + # Although the plain scalar writer supports breaks, we never emit + # multiline plain scalars. + if line_breaks: + allow_flow_plain = allow_block_plain = False + + # Flow indicators are forbidden for flow plain scalars. + if flow_indicators: + allow_flow_plain = False + + # Block indicators are forbidden for block plain scalars. + if block_indicators: + allow_block_plain = False + + return ScalarAnalysis(scalar=scalar, + empty=False, multiline=line_breaks, + allow_flow_plain=allow_flow_plain, + allow_block_plain=allow_block_plain, + allow_single_quoted=allow_single_quoted, + allow_double_quoted=allow_double_quoted, + allow_block=allow_block) + + # Writers. + + def flush_stream(self): + if hasattr(self.stream, 'flush'): + self.stream.flush() + + def write_stream_start(self): + # Write BOM if needed. + if self.encoding and self.encoding.startswith('utf-16'): + self.stream.write('\uFEFF'.encode(self.encoding)) + + def write_stream_end(self): + self.flush_stream() + + def write_indicator(self, indicator, need_whitespace, + whitespace=False, indention=False): + if self.whitespace or not need_whitespace: + data = indicator + else: + data = ' '+indicator + self.whitespace = whitespace + self.indention = self.indention and indention + self.column += len(data) + self.open_ended = False + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_indent(self): + indent = self.indent or 0 + if not self.indention or self.column > indent \ + or (self.column == indent and not self.whitespace): + self.write_line_break() + if self.column < indent: + self.whitespace = True + data = ' '*(indent-self.column) + self.column = indent + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_line_break(self, data=None): + if data is None: + data = self.best_line_break + self.whitespace = True + self.indention = True + self.line += 1 + self.column = 0 + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_version_directive(self, version_text): + data = '%%YAML %s' % version_text + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_line_break() + + def write_tag_directive(self, handle_text, prefix_text): + data = '%%TAG %s %s' % (handle_text, prefix_text) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_line_break() + + # Scalar streams. + + def write_single_quoted(self, text, split=True): + self.write_indicator('\'', True) + spaces = False + breaks = False + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if spaces: + if ch is None or ch != ' ': + if start+1 == end and self.column > self.best_width and split \ + and start != 0 and end != len(text): + self.write_indent() + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + elif breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + if text[start] == '\n': + self.write_line_break() + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + self.write_indent() + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029' or ch == '\'': + if start < end: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch == '\'': + data = '\'\'' + self.column += 2 + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + 1 + if ch is not None: + spaces = (ch == ' ') + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 + self.write_indicator('\'', False) + + ESCAPE_REPLACEMENTS = { + '\0': '0', + '\x07': 'a', + '\x08': 'b', + '\x09': 't', + '\x0A': 'n', + '\x0B': 'v', + '\x0C': 'f', + '\x0D': 'r', + '\x1B': 'e', + '\"': '\"', + '\\': '\\', + '\x85': 'N', + '\xA0': '_', + '\u2028': 'L', + '\u2029': 'P', + } + + def write_double_quoted(self, text, split=True): + self.write_indicator('"', True) + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if ch is None or ch in '"\\\x85\u2028\u2029\uFEFF' \ + or not ('\x20' <= ch <= '\x7E' + or (self.allow_unicode + and ('\xA0' <= ch <= '\uD7FF' + or '\uE000' <= ch <= '\uFFFD'))): + if start < end: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch is not None: + if ch in self.ESCAPE_REPLACEMENTS: + data = '\\'+self.ESCAPE_REPLACEMENTS[ch] + elif ch <= '\xFF': + data = '\\x%02X' % ord(ch) + elif ch <= '\uFFFF': + data = '\\u%04X' % ord(ch) + else: + data = '\\U%08X' % ord(ch) + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end+1 + if 0 < end < len(text)-1 and (ch == ' ' or start >= end) \ + and self.column+(end-start) > self.best_width and split: + data = text[start:end]+'\\' + if start < end: + start = end + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_indent() + self.whitespace = False + self.indention = False + if text[start] == ' ': + data = '\\' + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + end += 1 + self.write_indicator('"', False) + + def determine_block_hints(self, text): + hints = '' + if text: + if text[0] in ' \n\x85\u2028\u2029': + hints += str(self.best_indent) + if text[-1] not in '\n\x85\u2028\u2029': + hints += '-' + elif len(text) == 1 or text[-2] in '\n\x85\u2028\u2029': + hints += '+' + return hints + + def write_folded(self, text): + hints = self.determine_block_hints(text) + self.write_indicator('>'+hints, True) + if hints[-1:] == '+': + self.open_ended = True + self.write_line_break() + leading_space = True + spaces = False + breaks = True + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + if not leading_space and ch is not None and ch != ' ' \ + and text[start] == '\n': + self.write_line_break() + leading_space = (ch == ' ') + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + if ch is not None: + self.write_indent() + start = end + elif spaces: + if ch != ' ': + if start+1 == end and self.column > self.best_width: + self.write_indent() + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029': + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + if ch is None: + self.write_line_break() + start = end + if ch is not None: + breaks = (ch in '\n\x85\u2028\u2029') + spaces = (ch == ' ') + end += 1 + + def write_literal(self, text): + hints = self.determine_block_hints(text) + self.write_indicator('|'+hints, True) + if hints[-1:] == '+': + self.open_ended = True + self.write_line_break() + breaks = True + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + if ch is not None: + self.write_indent() + start = end + else: + if ch is None or ch in '\n\x85\u2028\u2029': + data = text[start:end] + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + if ch is None: + self.write_line_break() + start = end + if ch is not None: + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 + + def write_plain(self, text, split=True): + if self.root_context: + self.open_ended = True + if not text: + return + if not self.whitespace: + data = ' ' + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.whitespace = False + self.indention = False + spaces = False + breaks = False + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if spaces: + if ch != ' ': + if start+1 == end and self.column > self.best_width and split: + self.write_indent() + self.whitespace = False + self.indention = False + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + elif breaks: + if ch not in '\n\x85\u2028\u2029': + if text[start] == '\n': + self.write_line_break() + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + self.write_indent() + self.whitespace = False + self.indention = False + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029': + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch is not None: + spaces = (ch == ' ') + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/error.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/error.py new file mode 100644 index 00000000..b796b4dc --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/error.py @@ -0,0 +1,75 @@ + +__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] + +class Mark: + + def __init__(self, name, index, line, column, buffer, pointer): + self.name = name + self.index = index + self.line = line + self.column = column + self.buffer = buffer + self.pointer = pointer + + def get_snippet(self, indent=4, max_length=75): + if self.buffer is None: + return None + head = '' + start = self.pointer + while start > 0 and self.buffer[start-1] not in '\0\r\n\x85\u2028\u2029': + start -= 1 + if self.pointer-start > max_length/2-1: + head = ' ... ' + start += 5 + break + tail = '' + end = self.pointer + while end < len(self.buffer) and self.buffer[end] not in '\0\r\n\x85\u2028\u2029': + end += 1 + if end-self.pointer > max_length/2-1: + tail = ' ... ' + end -= 5 + break + snippet = self.buffer[start:end] + return ' '*indent + head + snippet + tail + '\n' \ + + ' '*(indent+self.pointer-start+len(head)) + '^' + + def __str__(self): + snippet = self.get_snippet() + where = " in \"%s\", line %d, column %d" \ + % (self.name, self.line+1, self.column+1) + if snippet is not None: + where += ":\n"+snippet + return where + +class YAMLError(Exception): + pass + +class MarkedYAMLError(YAMLError): + + def __init__(self, context=None, context_mark=None, + problem=None, problem_mark=None, note=None): + self.context = context + self.context_mark = context_mark + self.problem = problem + self.problem_mark = problem_mark + self.note = note + + def __str__(self): + lines = [] + if self.context is not None: + lines.append(self.context) + if self.context_mark is not None \ + and (self.problem is None or self.problem_mark is None + or self.context_mark.name != self.problem_mark.name + or self.context_mark.line != self.problem_mark.line + or self.context_mark.column != self.problem_mark.column): + lines.append(str(self.context_mark)) + if self.problem is not None: + lines.append(self.problem) + if self.problem_mark is not None: + lines.append(str(self.problem_mark)) + if self.note is not None: + lines.append(self.note) + return '\n'.join(lines) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/events.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/events.py new file mode 100644 index 00000000..f79ad389 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/events.py @@ -0,0 +1,86 @@ + +# Abstract classes. + +class Event(object): + def __init__(self, start_mark=None, end_mark=None): + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] + if hasattr(self, key)] + arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) + for key in attributes]) + return '%s(%s)' % (self.__class__.__name__, arguments) + +class NodeEvent(Event): + def __init__(self, anchor, start_mark=None, end_mark=None): + self.anchor = anchor + self.start_mark = start_mark + self.end_mark = end_mark + +class CollectionStartEvent(NodeEvent): + def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None, + flow_style=None): + self.anchor = anchor + self.tag = tag + self.implicit = implicit + self.start_mark = start_mark + self.end_mark = end_mark + self.flow_style = flow_style + +class CollectionEndEvent(Event): + pass + +# Implementations. + +class StreamStartEvent(Event): + def __init__(self, start_mark=None, end_mark=None, encoding=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.encoding = encoding + +class StreamEndEvent(Event): + pass + +class DocumentStartEvent(Event): + def __init__(self, start_mark=None, end_mark=None, + explicit=None, version=None, tags=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.explicit = explicit + self.version = version + self.tags = tags + +class DocumentEndEvent(Event): + def __init__(self, start_mark=None, end_mark=None, + explicit=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.explicit = explicit + +class AliasEvent(NodeEvent): + pass + +class ScalarEvent(NodeEvent): + def __init__(self, anchor, tag, implicit, value, + start_mark=None, end_mark=None, style=None): + self.anchor = anchor + self.tag = tag + self.implicit = implicit + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + +class SequenceStartEvent(CollectionStartEvent): + pass + +class SequenceEndEvent(CollectionEndEvent): + pass + +class MappingStartEvent(CollectionStartEvent): + pass + +class MappingEndEvent(CollectionEndEvent): + pass + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/loader.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/loader.py new file mode 100644 index 00000000..e90c1122 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/loader.py @@ -0,0 +1,63 @@ + +__all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader'] + +from .reader import * +from .scanner import * +from .parser import * +from .composer import * +from .constructor import * +from .resolver import * + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) + +# UnsafeLoader is the same as Loader (which is and was always unsafe on +# untrusted input). Use of either Loader or UnsafeLoader should be rare, since +# FullLoad should be able to load almost all YAML safely. Loader is left intact +# to ensure backwards compatibility. +class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/nodes.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/nodes.py new file mode 100644 index 00000000..c4f070c4 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/nodes.py @@ -0,0 +1,49 @@ + +class Node(object): + def __init__(self, tag, value, start_mark, end_mark): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + value = self.value + #if isinstance(value, list): + # if len(value) == 0: + # value = '' + # elif len(value) == 1: + # value = '<1 item>' + # else: + # value = '<%d items>' % len(value) + #else: + # if len(value) > 75: + # value = repr(value[:70]+u' ... ') + # else: + # value = repr(value) + value = repr(value) + return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value) + +class ScalarNode(Node): + id = 'scalar' + def __init__(self, tag, value, + start_mark=None, end_mark=None, style=None): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + +class CollectionNode(Node): + def __init__(self, tag, value, + start_mark=None, end_mark=None, flow_style=None): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.flow_style = flow_style + +class SequenceNode(CollectionNode): + id = 'sequence' + +class MappingNode(CollectionNode): + id = 'mapping' + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/parser.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/parser.py new file mode 100644 index 00000000..13a5995d --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/parser.py @@ -0,0 +1,589 @@ + +# The following YAML grammar is LL(1) and is parsed by a recursive descent +# parser. +# +# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END +# implicit_document ::= block_node DOCUMENT-END* +# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +# block_node_or_indentless_sequence ::= +# ALIAS +# | properties (block_content | indentless_block_sequence)? +# | block_content +# | indentless_block_sequence +# block_node ::= ALIAS +# | properties block_content? +# | block_content +# flow_node ::= ALIAS +# | properties flow_content? +# | flow_content +# properties ::= TAG ANCHOR? | ANCHOR TAG? +# block_content ::= block_collection | flow_collection | SCALAR +# flow_content ::= flow_collection | SCALAR +# block_collection ::= block_sequence | block_mapping +# flow_collection ::= flow_sequence | flow_mapping +# block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END +# indentless_sequence ::= (BLOCK-ENTRY block_node?)+ +# block_mapping ::= BLOCK-MAPPING_START +# ((KEY block_node_or_indentless_sequence?)? +# (VALUE block_node_or_indentless_sequence?)?)* +# BLOCK-END +# flow_sequence ::= FLOW-SEQUENCE-START +# (flow_sequence_entry FLOW-ENTRY)* +# flow_sequence_entry? +# FLOW-SEQUENCE-END +# flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +# flow_mapping ::= FLOW-MAPPING-START +# (flow_mapping_entry FLOW-ENTRY)* +# flow_mapping_entry? +# FLOW-MAPPING-END +# flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +# +# FIRST sets: +# +# stream: { STREAM-START } +# explicit_document: { DIRECTIVE DOCUMENT-START } +# implicit_document: FIRST(block_node) +# block_node: { ALIAS TAG ANCHOR SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START } +# flow_node: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START } +# block_content: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR } +# flow_content: { FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR } +# block_collection: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START } +# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START } +# block_sequence: { BLOCK-SEQUENCE-START } +# block_mapping: { BLOCK-MAPPING-START } +# block_node_or_indentless_sequence: { ALIAS ANCHOR TAG SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START BLOCK-ENTRY } +# indentless_sequence: { ENTRY } +# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START } +# flow_sequence: { FLOW-SEQUENCE-START } +# flow_mapping: { FLOW-MAPPING-START } +# flow_sequence_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY } +# flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY } + +__all__ = ['Parser', 'ParserError'] + +from .error import MarkedYAMLError +from .tokens import * +from .events import * +from .scanner import * + +class ParserError(MarkedYAMLError): + pass + +class Parser: + # Since writing a recursive-descendant parser is a straightforward task, we + # do not give many comments here. + + DEFAULT_TAGS = { + '!': '!', + '!!': 'tag:yaml.org,2002:', + } + + def __init__(self): + self.current_event = None + self.yaml_version = None + self.tag_handles = {} + self.states = [] + self.marks = [] + self.state = self.parse_stream_start + + def dispose(self): + # Reset the state attributes (to clear self-references) + self.states = [] + self.state = None + + def check_event(self, *choices): + # Check the type of the next event. + if self.current_event is None: + if self.state: + self.current_event = self.state() + if self.current_event is not None: + if not choices: + return True + for choice in choices: + if isinstance(self.current_event, choice): + return True + return False + + def peek_event(self): + # Get the next event. + if self.current_event is None: + if self.state: + self.current_event = self.state() + return self.current_event + + def get_event(self): + # Get the next event and proceed further. + if self.current_event is None: + if self.state: + self.current_event = self.state() + value = self.current_event + self.current_event = None + return value + + # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END + # implicit_document ::= block_node DOCUMENT-END* + # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* + + def parse_stream_start(self): + + # Parse the stream start. + token = self.get_token() + event = StreamStartEvent(token.start_mark, token.end_mark, + encoding=token.encoding) + + # Prepare the next state. + self.state = self.parse_implicit_document_start + + return event + + def parse_implicit_document_start(self): + + # Parse an implicit document. + if not self.check_token(DirectiveToken, DocumentStartToken, + StreamEndToken): + self.tag_handles = self.DEFAULT_TAGS + token = self.peek_token() + start_mark = end_mark = token.start_mark + event = DocumentStartEvent(start_mark, end_mark, + explicit=False) + + # Prepare the next state. + self.states.append(self.parse_document_end) + self.state = self.parse_block_node + + return event + + else: + return self.parse_document_start() + + def parse_document_start(self): + + # Parse any extra document end indicators. + while self.check_token(DocumentEndToken): + self.get_token() + + # Parse an explicit document. + if not self.check_token(StreamEndToken): + token = self.peek_token() + start_mark = token.start_mark + version, tags = self.process_directives() + if not self.check_token(DocumentStartToken): + raise ParserError(None, None, + "expected '', but found %r" + % self.peek_token().id, + self.peek_token().start_mark) + token = self.get_token() + end_mark = token.end_mark + event = DocumentStartEvent(start_mark, end_mark, + explicit=True, version=version, tags=tags) + self.states.append(self.parse_document_end) + self.state = self.parse_document_content + else: + # Parse the end of the stream. + token = self.get_token() + event = StreamEndEvent(token.start_mark, token.end_mark) + assert not self.states + assert not self.marks + self.state = None + return event + + def parse_document_end(self): + + # Parse the document end. + token = self.peek_token() + start_mark = end_mark = token.start_mark + explicit = False + if self.check_token(DocumentEndToken): + token = self.get_token() + end_mark = token.end_mark + explicit = True + event = DocumentEndEvent(start_mark, end_mark, + explicit=explicit) + + # Prepare the next state. + self.state = self.parse_document_start + + return event + + def parse_document_content(self): + if self.check_token(DirectiveToken, + DocumentStartToken, DocumentEndToken, StreamEndToken): + event = self.process_empty_scalar(self.peek_token().start_mark) + self.state = self.states.pop() + return event + else: + return self.parse_block_node() + + def process_directives(self): + self.yaml_version = None + self.tag_handles = {} + while self.check_token(DirectiveToken): + token = self.get_token() + if token.name == 'YAML': + if self.yaml_version is not None: + raise ParserError(None, None, + "found duplicate YAML directive", token.start_mark) + major, minor = token.value + if major != 1: + raise ParserError(None, None, + "found incompatible YAML document (version 1.* is required)", + token.start_mark) + self.yaml_version = token.value + elif token.name == 'TAG': + handle, prefix = token.value + if handle in self.tag_handles: + raise ParserError(None, None, + "duplicate tag handle %r" % handle, + token.start_mark) + self.tag_handles[handle] = prefix + if self.tag_handles: + value = self.yaml_version, self.tag_handles.copy() + else: + value = self.yaml_version, None + for key in self.DEFAULT_TAGS: + if key not in self.tag_handles: + self.tag_handles[key] = self.DEFAULT_TAGS[key] + return value + + # block_node_or_indentless_sequence ::= ALIAS + # | properties (block_content | indentless_block_sequence)? + # | block_content + # | indentless_block_sequence + # block_node ::= ALIAS + # | properties block_content? + # | block_content + # flow_node ::= ALIAS + # | properties flow_content? + # | flow_content + # properties ::= TAG ANCHOR? | ANCHOR TAG? + # block_content ::= block_collection | flow_collection | SCALAR + # flow_content ::= flow_collection | SCALAR + # block_collection ::= block_sequence | block_mapping + # flow_collection ::= flow_sequence | flow_mapping + + def parse_block_node(self): + return self.parse_node(block=True) + + def parse_flow_node(self): + return self.parse_node() + + def parse_block_node_or_indentless_sequence(self): + return self.parse_node(block=True, indentless_sequence=True) + + def parse_node(self, block=False, indentless_sequence=False): + if self.check_token(AliasToken): + token = self.get_token() + event = AliasEvent(token.value, token.start_mark, token.end_mark) + self.state = self.states.pop() + else: + anchor = None + tag = None + start_mark = end_mark = tag_mark = None + if self.check_token(AnchorToken): + token = self.get_token() + start_mark = token.start_mark + end_mark = token.end_mark + anchor = token.value + if self.check_token(TagToken): + token = self.get_token() + tag_mark = token.start_mark + end_mark = token.end_mark + tag = token.value + elif self.check_token(TagToken): + token = self.get_token() + start_mark = tag_mark = token.start_mark + end_mark = token.end_mark + tag = token.value + if self.check_token(AnchorToken): + token = self.get_token() + end_mark = token.end_mark + anchor = token.value + if tag is not None: + handle, suffix = tag + if handle is not None: + if handle not in self.tag_handles: + raise ParserError("while parsing a node", start_mark, + "found undefined tag handle %r" % handle, + tag_mark) + tag = self.tag_handles[handle]+suffix + else: + tag = suffix + #if tag == '!': + # raise ParserError("while parsing a node", start_mark, + # "found non-specific tag '!'", tag_mark, + # "Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.") + if start_mark is None: + start_mark = end_mark = self.peek_token().start_mark + event = None + implicit = (tag is None or tag == '!') + if indentless_sequence and self.check_token(BlockEntryToken): + end_mark = self.peek_token().end_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark) + self.state = self.parse_indentless_sequence_entry + else: + if self.check_token(ScalarToken): + token = self.get_token() + end_mark = token.end_mark + if (token.plain and tag is None) or tag == '!': + implicit = (True, False) + elif tag is None: + implicit = (False, True) + else: + implicit = (False, False) + event = ScalarEvent(anchor, tag, implicit, token.value, + start_mark, end_mark, style=token.style) + self.state = self.states.pop() + elif self.check_token(FlowSequenceStartToken): + end_mark = self.peek_token().end_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=True) + self.state = self.parse_flow_sequence_first_entry + elif self.check_token(FlowMappingStartToken): + end_mark = self.peek_token().end_mark + event = MappingStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=True) + self.state = self.parse_flow_mapping_first_key + elif block and self.check_token(BlockSequenceStartToken): + end_mark = self.peek_token().start_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=False) + self.state = self.parse_block_sequence_first_entry + elif block and self.check_token(BlockMappingStartToken): + end_mark = self.peek_token().start_mark + event = MappingStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=False) + self.state = self.parse_block_mapping_first_key + elif anchor is not None or tag is not None: + # Empty scalars are allowed even if a tag or an anchor is + # specified. + event = ScalarEvent(anchor, tag, (implicit, False), '', + start_mark, end_mark) + self.state = self.states.pop() + else: + if block: + node = 'block' + else: + node = 'flow' + token = self.peek_token() + raise ParserError("while parsing a %s node" % node, start_mark, + "expected the node content, but found %r" % token.id, + token.start_mark) + return event + + # block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END + + def parse_block_sequence_first_entry(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_block_sequence_entry() + + def parse_block_sequence_entry(self): + if self.check_token(BlockEntryToken): + token = self.get_token() + if not self.check_token(BlockEntryToken, BlockEndToken): + self.states.append(self.parse_block_sequence_entry) + return self.parse_block_node() + else: + self.state = self.parse_block_sequence_entry + return self.process_empty_scalar(token.end_mark) + if not self.check_token(BlockEndToken): + token = self.peek_token() + raise ParserError("while parsing a block collection", self.marks[-1], + "expected , but found %r" % token.id, token.start_mark) + token = self.get_token() + event = SequenceEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + # indentless_sequence ::= (BLOCK-ENTRY block_node?)+ + + def parse_indentless_sequence_entry(self): + if self.check_token(BlockEntryToken): + token = self.get_token() + if not self.check_token(BlockEntryToken, + KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_indentless_sequence_entry) + return self.parse_block_node() + else: + self.state = self.parse_indentless_sequence_entry + return self.process_empty_scalar(token.end_mark) + token = self.peek_token() + event = SequenceEndEvent(token.start_mark, token.start_mark) + self.state = self.states.pop() + return event + + # block_mapping ::= BLOCK-MAPPING_START + # ((KEY block_node_or_indentless_sequence?)? + # (VALUE block_node_or_indentless_sequence?)?)* + # BLOCK-END + + def parse_block_mapping_first_key(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_block_mapping_key() + + def parse_block_mapping_key(self): + if self.check_token(KeyToken): + token = self.get_token() + if not self.check_token(KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_block_mapping_value) + return self.parse_block_node_or_indentless_sequence() + else: + self.state = self.parse_block_mapping_value + return self.process_empty_scalar(token.end_mark) + if not self.check_token(BlockEndToken): + token = self.peek_token() + raise ParserError("while parsing a block mapping", self.marks[-1], + "expected , but found %r" % token.id, token.start_mark) + token = self.get_token() + event = MappingEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_block_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_block_mapping_key) + return self.parse_block_node_or_indentless_sequence() + else: + self.state = self.parse_block_mapping_key + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_block_mapping_key + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + # flow_sequence ::= FLOW-SEQUENCE-START + # (flow_sequence_entry FLOW-ENTRY)* + # flow_sequence_entry? + # FLOW-SEQUENCE-END + # flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + # + # Note that while production rules for both flow_sequence_entry and + # flow_mapping_entry are equal, their interpretations are different. + # For `flow_sequence_entry`, the part `KEY flow_node? (VALUE flow_node?)?` + # generate an inline mapping (set syntax). + + def parse_flow_sequence_first_entry(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_flow_sequence_entry(first=True) + + def parse_flow_sequence_entry(self, first=False): + if not self.check_token(FlowSequenceEndToken): + if not first: + if self.check_token(FlowEntryToken): + self.get_token() + else: + token = self.peek_token() + raise ParserError("while parsing a flow sequence", self.marks[-1], + "expected ',' or ']', but got %r" % token.id, token.start_mark) + + if self.check_token(KeyToken): + token = self.peek_token() + event = MappingStartEvent(None, None, True, + token.start_mark, token.end_mark, + flow_style=True) + self.state = self.parse_flow_sequence_entry_mapping_key + return event + elif not self.check_token(FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry) + return self.parse_flow_node() + token = self.get_token() + event = SequenceEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_flow_sequence_entry_mapping_key(self): + token = self.get_token() + if not self.check_token(ValueToken, + FlowEntryToken, FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry_mapping_value) + return self.parse_flow_node() + else: + self.state = self.parse_flow_sequence_entry_mapping_value + return self.process_empty_scalar(token.end_mark) + + def parse_flow_sequence_entry_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(FlowEntryToken, FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry_mapping_end) + return self.parse_flow_node() + else: + self.state = self.parse_flow_sequence_entry_mapping_end + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_flow_sequence_entry_mapping_end + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + def parse_flow_sequence_entry_mapping_end(self): + self.state = self.parse_flow_sequence_entry + token = self.peek_token() + return MappingEndEvent(token.start_mark, token.start_mark) + + # flow_mapping ::= FLOW-MAPPING-START + # (flow_mapping_entry FLOW-ENTRY)* + # flow_mapping_entry? + # FLOW-MAPPING-END + # flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + + def parse_flow_mapping_first_key(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_flow_mapping_key(first=True) + + def parse_flow_mapping_key(self, first=False): + if not self.check_token(FlowMappingEndToken): + if not first: + if self.check_token(FlowEntryToken): + self.get_token() + else: + token = self.peek_token() + raise ParserError("while parsing a flow mapping", self.marks[-1], + "expected ',' or '}', but got %r" % token.id, token.start_mark) + if self.check_token(KeyToken): + token = self.get_token() + if not self.check_token(ValueToken, + FlowEntryToken, FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_value) + return self.parse_flow_node() + else: + self.state = self.parse_flow_mapping_value + return self.process_empty_scalar(token.end_mark) + elif not self.check_token(FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_empty_value) + return self.parse_flow_node() + token = self.get_token() + event = MappingEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_flow_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(FlowEntryToken, FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_key) + return self.parse_flow_node() + else: + self.state = self.parse_flow_mapping_key + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_flow_mapping_key + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + def parse_flow_mapping_empty_value(self): + self.state = self.parse_flow_mapping_key + return self.process_empty_scalar(self.peek_token().start_mark) + + def process_empty_scalar(self, mark): + return ScalarEvent(None, None, (True, False), '', mark, mark) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/reader.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/reader.py new file mode 100644 index 00000000..774b0219 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/reader.py @@ -0,0 +1,185 @@ +# This module contains abstractions for the input stream. You don't have to +# looks further, there are no pretty code. +# +# We define two classes here. +# +# Mark(source, line, column) +# It's just a record and its only use is producing nice error messages. +# Parser does not use it for any other purposes. +# +# Reader(source, data) +# Reader determines the encoding of `data` and converts it to unicode. +# Reader provides the following methods and attributes: +# reader.peek(length=1) - return the next `length` characters +# reader.forward(length=1) - move the current position to `length` characters. +# reader.index - the number of the current character. +# reader.line, stream.column - the line and the column of the current character. + +__all__ = ['Reader', 'ReaderError'] + +from .error import YAMLError, Mark + +import codecs, re + +class ReaderError(YAMLError): + + def __init__(self, name, position, character, encoding, reason): + self.name = name + self.character = character + self.position = position + self.encoding = encoding + self.reason = reason + + def __str__(self): + if isinstance(self.character, bytes): + return "'%s' codec can't decode byte #x%02x: %s\n" \ + " in \"%s\", position %d" \ + % (self.encoding, ord(self.character), self.reason, + self.name, self.position) + else: + return "unacceptable character #x%04x: %s\n" \ + " in \"%s\", position %d" \ + % (self.character, self.reason, + self.name, self.position) + +class Reader(object): + # Reader: + # - determines the data encoding and converts it to a unicode string, + # - checks if characters are in allowed range, + # - adds '\0' to the end. + + # Reader accepts + # - a `bytes` object, + # - a `str` object, + # - a file-like object with its `read` method returning `str`, + # - a file-like object with its `read` method returning `unicode`. + + # Yeah, it's ugly and slow. + + def __init__(self, stream): + self.name = None + self.stream = None + self.stream_pointer = 0 + self.eof = True + self.buffer = '' + self.pointer = 0 + self.raw_buffer = None + self.raw_decode = None + self.encoding = None + self.index = 0 + self.line = 0 + self.column = 0 + if isinstance(stream, str): + self.name = "" + self.check_printable(stream) + self.buffer = stream+'\0' + elif isinstance(stream, bytes): + self.name = "" + self.raw_buffer = stream + self.determine_encoding() + else: + self.stream = stream + self.name = getattr(stream, 'name', "") + self.eof = False + self.raw_buffer = None + self.determine_encoding() + + def peek(self, index=0): + try: + return self.buffer[self.pointer+index] + except IndexError: + self.update(index+1) + return self.buffer[self.pointer+index] + + def prefix(self, length=1): + if self.pointer+length >= len(self.buffer): + self.update(length) + return self.buffer[self.pointer:self.pointer+length] + + def forward(self, length=1): + if self.pointer+length+1 >= len(self.buffer): + self.update(length+1) + while length: + ch = self.buffer[self.pointer] + self.pointer += 1 + self.index += 1 + if ch in '\n\x85\u2028\u2029' \ + or (ch == '\r' and self.buffer[self.pointer] != '\n'): + self.line += 1 + self.column = 0 + elif ch != '\uFEFF': + self.column += 1 + length -= 1 + + def get_mark(self): + if self.stream is None: + return Mark(self.name, self.index, self.line, self.column, + self.buffer, self.pointer) + else: + return Mark(self.name, self.index, self.line, self.column, + None, None) + + def determine_encoding(self): + while not self.eof and (self.raw_buffer is None or len(self.raw_buffer) < 2): + self.update_raw() + if isinstance(self.raw_buffer, bytes): + if self.raw_buffer.startswith(codecs.BOM_UTF16_LE): + self.raw_decode = codecs.utf_16_le_decode + self.encoding = 'utf-16-le' + elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE): + self.raw_decode = codecs.utf_16_be_decode + self.encoding = 'utf-16-be' + else: + self.raw_decode = codecs.utf_8_decode + self.encoding = 'utf-8' + self.update(1) + + NON_PRINTABLE = re.compile('[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uD7FF\uE000-\uFFFD\U00010000-\U0010ffff]') + def check_printable(self, data): + match = self.NON_PRINTABLE.search(data) + if match: + character = match.group() + position = self.index+(len(self.buffer)-self.pointer)+match.start() + raise ReaderError(self.name, position, ord(character), + 'unicode', "special characters are not allowed") + + def update(self, length): + if self.raw_buffer is None: + return + self.buffer = self.buffer[self.pointer:] + self.pointer = 0 + while len(self.buffer) < length: + if not self.eof: + self.update_raw() + if self.raw_decode is not None: + try: + data, converted = self.raw_decode(self.raw_buffer, + 'strict', self.eof) + except UnicodeDecodeError as exc: + character = self.raw_buffer[exc.start] + if self.stream is not None: + position = self.stream_pointer-len(self.raw_buffer)+exc.start + else: + position = exc.start + raise ReaderError(self.name, position, character, + exc.encoding, exc.reason) + else: + data = self.raw_buffer + converted = len(data) + self.check_printable(data) + self.buffer += data + self.raw_buffer = self.raw_buffer[converted:] + if self.eof: + self.buffer += '\0' + self.raw_buffer = None + break + + def update_raw(self, size=4096): + data = self.stream.read(size) + if self.raw_buffer is None: + self.raw_buffer = data + else: + self.raw_buffer += data + self.stream_pointer += len(data) + if not data: + self.eof = True diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/representer.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/representer.py new file mode 100644 index 00000000..3b0b192e --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/representer.py @@ -0,0 +1,389 @@ + +__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', + 'RepresenterError'] + +from .error import * +from .nodes import * + +import datetime, copyreg, types, base64, collections + +class RepresenterError(YAMLError): + pass + +class BaseRepresenter: + + yaml_representers = {} + yaml_multi_representers = {} + + def __init__(self, default_style=None, default_flow_style=False, sort_keys=True): + self.default_style = default_style + self.sort_keys = sort_keys + self.default_flow_style = default_flow_style + self.represented_objects = {} + self.object_keeper = [] + self.alias_key = None + + def represent(self, data): + node = self.represent_data(data) + self.serialize(node) + self.represented_objects = {} + self.object_keeper = [] + self.alias_key = None + + def represent_data(self, data): + if self.ignore_aliases(data): + self.alias_key = None + else: + self.alias_key = id(data) + if self.alias_key is not None: + if self.alias_key in self.represented_objects: + node = self.represented_objects[self.alias_key] + #if node is None: + # raise RepresenterError("recursive objects are not allowed: %r" % data) + return node + #self.represented_objects[alias_key] = None + self.object_keeper.append(data) + data_types = type(data).__mro__ + if data_types[0] in self.yaml_representers: + node = self.yaml_representers[data_types[0]](self, data) + else: + for data_type in data_types: + if data_type in self.yaml_multi_representers: + node = self.yaml_multi_representers[data_type](self, data) + break + else: + if None in self.yaml_multi_representers: + node = self.yaml_multi_representers[None](self, data) + elif None in self.yaml_representers: + node = self.yaml_representers[None](self, data) + else: + node = ScalarNode(None, str(data)) + #if alias_key is not None: + # self.represented_objects[alias_key] = node + return node + + @classmethod + def add_representer(cls, data_type, representer): + if not 'yaml_representers' in cls.__dict__: + cls.yaml_representers = cls.yaml_representers.copy() + cls.yaml_representers[data_type] = representer + + @classmethod + def add_multi_representer(cls, data_type, representer): + if not 'yaml_multi_representers' in cls.__dict__: + cls.yaml_multi_representers = cls.yaml_multi_representers.copy() + cls.yaml_multi_representers[data_type] = representer + + def represent_scalar(self, tag, value, style=None): + if style is None: + style = self.default_style + node = ScalarNode(tag, value, style=style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + return node + + def represent_sequence(self, tag, sequence, flow_style=None): + value = [] + node = SequenceNode(tag, value, flow_style=flow_style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + best_style = True + for item in sequence: + node_item = self.represent_data(item) + if not (isinstance(node_item, ScalarNode) and not node_item.style): + best_style = False + value.append(node_item) + if flow_style is None: + if self.default_flow_style is not None: + node.flow_style = self.default_flow_style + else: + node.flow_style = best_style + return node + + def represent_mapping(self, tag, mapping, flow_style=None): + value = [] + node = MappingNode(tag, value, flow_style=flow_style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + best_style = True + if hasattr(mapping, 'items'): + mapping = list(mapping.items()) + if self.sort_keys: + try: + mapping = sorted(mapping) + except TypeError: + pass + for item_key, item_value in mapping: + node_key = self.represent_data(item_key) + node_value = self.represent_data(item_value) + if not (isinstance(node_key, ScalarNode) and not node_key.style): + best_style = False + if not (isinstance(node_value, ScalarNode) and not node_value.style): + best_style = False + value.append((node_key, node_value)) + if flow_style is None: + if self.default_flow_style is not None: + node.flow_style = self.default_flow_style + else: + node.flow_style = best_style + return node + + def ignore_aliases(self, data): + return False + +class SafeRepresenter(BaseRepresenter): + + def ignore_aliases(self, data): + if data is None: + return True + if isinstance(data, tuple) and data == (): + return True + if isinstance(data, (str, bytes, bool, int, float)): + return True + + def represent_none(self, data): + return self.represent_scalar('tag:yaml.org,2002:null', 'null') + + def represent_str(self, data): + return self.represent_scalar('tag:yaml.org,2002:str', data) + + def represent_binary(self, data): + if hasattr(base64, 'encodebytes'): + data = base64.encodebytes(data).decode('ascii') + else: + data = base64.encodestring(data).decode('ascii') + return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|') + + def represent_bool(self, data): + if data: + value = 'true' + else: + value = 'false' + return self.represent_scalar('tag:yaml.org,2002:bool', value) + + def represent_int(self, data): + return self.represent_scalar('tag:yaml.org,2002:int', str(data)) + + inf_value = 1e300 + while repr(inf_value) != repr(inf_value*inf_value): + inf_value *= inf_value + + def represent_float(self, data): + if data != data or (data == 0.0 and data == 1.0): + value = '.nan' + elif data == self.inf_value: + value = '.inf' + elif data == -self.inf_value: + value = '-.inf' + else: + value = repr(data).lower() + # Note that in some cases `repr(data)` represents a float number + # without the decimal parts. For instance: + # >>> repr(1e17) + # '1e17' + # Unfortunately, this is not a valid float representation according + # to the definition of the `!!float` tag. We fix this by adding + # '.0' before the 'e' symbol. + if '.' not in value and 'e' in value: + value = value.replace('e', '.0e', 1) + return self.represent_scalar('tag:yaml.org,2002:float', value) + + def represent_list(self, data): + #pairs = (len(data) > 0 and isinstance(data, list)) + #if pairs: + # for item in data: + # if not isinstance(item, tuple) or len(item) != 2: + # pairs = False + # break + #if not pairs: + return self.represent_sequence('tag:yaml.org,2002:seq', data) + #value = [] + #for item_key, item_value in data: + # value.append(self.represent_mapping(u'tag:yaml.org,2002:map', + # [(item_key, item_value)])) + #return SequenceNode(u'tag:yaml.org,2002:pairs', value) + + def represent_dict(self, data): + return self.represent_mapping('tag:yaml.org,2002:map', data) + + def represent_set(self, data): + value = {} + for key in data: + value[key] = None + return self.represent_mapping('tag:yaml.org,2002:set', value) + + def represent_date(self, data): + value = data.isoformat() + return self.represent_scalar('tag:yaml.org,2002:timestamp', value) + + def represent_datetime(self, data): + value = data.isoformat(' ') + return self.represent_scalar('tag:yaml.org,2002:timestamp', value) + + def represent_yaml_object(self, tag, data, cls, flow_style=None): + if hasattr(data, '__getstate__'): + state = data.__getstate__() + else: + state = data.__dict__.copy() + return self.represent_mapping(tag, state, flow_style=flow_style) + + def represent_undefined(self, data): + raise RepresenterError("cannot represent an object", data) + +SafeRepresenter.add_representer(type(None), + SafeRepresenter.represent_none) + +SafeRepresenter.add_representer(str, + SafeRepresenter.represent_str) + +SafeRepresenter.add_representer(bytes, + SafeRepresenter.represent_binary) + +SafeRepresenter.add_representer(bool, + SafeRepresenter.represent_bool) + +SafeRepresenter.add_representer(int, + SafeRepresenter.represent_int) + +SafeRepresenter.add_representer(float, + SafeRepresenter.represent_float) + +SafeRepresenter.add_representer(list, + SafeRepresenter.represent_list) + +SafeRepresenter.add_representer(tuple, + SafeRepresenter.represent_list) + +SafeRepresenter.add_representer(dict, + SafeRepresenter.represent_dict) + +SafeRepresenter.add_representer(set, + SafeRepresenter.represent_set) + +SafeRepresenter.add_representer(datetime.date, + SafeRepresenter.represent_date) + +SafeRepresenter.add_representer(datetime.datetime, + SafeRepresenter.represent_datetime) + +SafeRepresenter.add_representer(None, + SafeRepresenter.represent_undefined) + +class Representer(SafeRepresenter): + + def represent_complex(self, data): + if data.imag == 0.0: + data = '%r' % data.real + elif data.real == 0.0: + data = '%rj' % data.imag + elif data.imag > 0: + data = '%r+%rj' % (data.real, data.imag) + else: + data = '%r%rj' % (data.real, data.imag) + return self.represent_scalar('tag:yaml.org,2002:python/complex', data) + + def represent_tuple(self, data): + return self.represent_sequence('tag:yaml.org,2002:python/tuple', data) + + def represent_name(self, data): + name = '%s.%s' % (data.__module__, data.__name__) + return self.represent_scalar('tag:yaml.org,2002:python/name:'+name, '') + + def represent_module(self, data): + return self.represent_scalar( + 'tag:yaml.org,2002:python/module:'+data.__name__, '') + + def represent_object(self, data): + # We use __reduce__ API to save the data. data.__reduce__ returns + # a tuple of length 2-5: + # (function, args, state, listitems, dictitems) + + # For reconstructing, we calls function(*args), then set its state, + # listitems, and dictitems if they are not None. + + # A special case is when function.__name__ == '__newobj__'. In this + # case we create the object with args[0].__new__(*args). + + # Another special case is when __reduce__ returns a string - we don't + # support it. + + # We produce a !!python/object, !!python/object/new or + # !!python/object/apply node. + + cls = type(data) + if cls in copyreg.dispatch_table: + reduce = copyreg.dispatch_table[cls](data) + elif hasattr(data, '__reduce_ex__'): + reduce = data.__reduce_ex__(2) + elif hasattr(data, '__reduce__'): + reduce = data.__reduce__() + else: + raise RepresenterError("cannot represent an object", data) + reduce = (list(reduce)+[None]*5)[:5] + function, args, state, listitems, dictitems = reduce + args = list(args) + if state is None: + state = {} + if listitems is not None: + listitems = list(listitems) + if dictitems is not None: + dictitems = dict(dictitems) + if function.__name__ == '__newobj__': + function = args[0] + args = args[1:] + tag = 'tag:yaml.org,2002:python/object/new:' + newobj = True + else: + tag = 'tag:yaml.org,2002:python/object/apply:' + newobj = False + function_name = '%s.%s' % (function.__module__, function.__name__) + if not args and not listitems and not dictitems \ + and isinstance(state, dict) and newobj: + return self.represent_mapping( + 'tag:yaml.org,2002:python/object:'+function_name, state) + if not listitems and not dictitems \ + and isinstance(state, dict) and not state: + return self.represent_sequence(tag+function_name, args) + value = {} + if args: + value['args'] = args + if state or not isinstance(state, dict): + value['state'] = state + if listitems: + value['listitems'] = listitems + if dictitems: + value['dictitems'] = dictitems + return self.represent_mapping(tag+function_name, value) + + def represent_ordered_dict(self, data): + # Provide uniform representation across different Python versions. + data_type = type(data) + tag = 'tag:yaml.org,2002:python/object/apply:%s.%s' \ + % (data_type.__module__, data_type.__name__) + items = [[key, value] for key, value in data.items()] + return self.represent_sequence(tag, [items]) + +Representer.add_representer(complex, + Representer.represent_complex) + +Representer.add_representer(tuple, + Representer.represent_tuple) + +Representer.add_representer(type, + Representer.represent_name) + +Representer.add_representer(collections.OrderedDict, + Representer.represent_ordered_dict) + +Representer.add_representer(types.FunctionType, + Representer.represent_name) + +Representer.add_representer(types.BuiltinFunctionType, + Representer.represent_name) + +Representer.add_representer(types.ModuleType, + Representer.represent_module) + +Representer.add_multi_representer(object, + Representer.represent_object) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/resolver.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/resolver.py new file mode 100644 index 00000000..02b82e73 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/resolver.py @@ -0,0 +1,227 @@ + +__all__ = ['BaseResolver', 'Resolver'] + +from .error import * +from .nodes import * + +import re + +class ResolverError(YAMLError): + pass + +class BaseResolver: + + DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str' + DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq' + DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map' + + yaml_implicit_resolvers = {} + yaml_path_resolvers = {} + + def __init__(self): + self.resolver_exact_paths = [] + self.resolver_prefix_paths = [] + + @classmethod + def add_implicit_resolver(cls, tag, regexp, first): + if not 'yaml_implicit_resolvers' in cls.__dict__: + implicit_resolvers = {} + for key in cls.yaml_implicit_resolvers: + implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:] + cls.yaml_implicit_resolvers = implicit_resolvers + if first is None: + first = [None] + for ch in first: + cls.yaml_implicit_resolvers.setdefault(ch, []).append((tag, regexp)) + + @classmethod + def add_path_resolver(cls, tag, path, kind=None): + # Note: `add_path_resolver` is experimental. The API could be changed. + # `new_path` is a pattern that is matched against the path from the + # root to the node that is being considered. `node_path` elements are + # tuples `(node_check, index_check)`. `node_check` is a node class: + # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`. `None` + # matches any kind of a node. `index_check` could be `None`, a boolean + # value, a string value, or a number. `None` and `False` match against + # any _value_ of sequence and mapping nodes. `True` matches against + # any _key_ of a mapping node. A string `index_check` matches against + # a mapping value that corresponds to a scalar key which content is + # equal to the `index_check` value. An integer `index_check` matches + # against a sequence value with the index equal to `index_check`. + if not 'yaml_path_resolvers' in cls.__dict__: + cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy() + new_path = [] + for element in path: + if isinstance(element, (list, tuple)): + if len(element) == 2: + node_check, index_check = element + elif len(element) == 1: + node_check = element[0] + index_check = True + else: + raise ResolverError("Invalid path element: %s" % element) + else: + node_check = None + index_check = element + if node_check is str: + node_check = ScalarNode + elif node_check is list: + node_check = SequenceNode + elif node_check is dict: + node_check = MappingNode + elif node_check not in [ScalarNode, SequenceNode, MappingNode] \ + and not isinstance(node_check, str) \ + and node_check is not None: + raise ResolverError("Invalid node checker: %s" % node_check) + if not isinstance(index_check, (str, int)) \ + and index_check is not None: + raise ResolverError("Invalid index checker: %s" % index_check) + new_path.append((node_check, index_check)) + if kind is str: + kind = ScalarNode + elif kind is list: + kind = SequenceNode + elif kind is dict: + kind = MappingNode + elif kind not in [ScalarNode, SequenceNode, MappingNode] \ + and kind is not None: + raise ResolverError("Invalid node kind: %s" % kind) + cls.yaml_path_resolvers[tuple(new_path), kind] = tag + + def descend_resolver(self, current_node, current_index): + if not self.yaml_path_resolvers: + return + exact_paths = {} + prefix_paths = [] + if current_node: + depth = len(self.resolver_prefix_paths) + for path, kind in self.resolver_prefix_paths[-1]: + if self.check_resolver_prefix(depth, path, kind, + current_node, current_index): + if len(path) > depth: + prefix_paths.append((path, kind)) + else: + exact_paths[kind] = self.yaml_path_resolvers[path, kind] + else: + for path, kind in self.yaml_path_resolvers: + if not path: + exact_paths[kind] = self.yaml_path_resolvers[path, kind] + else: + prefix_paths.append((path, kind)) + self.resolver_exact_paths.append(exact_paths) + self.resolver_prefix_paths.append(prefix_paths) + + def ascend_resolver(self): + if not self.yaml_path_resolvers: + return + self.resolver_exact_paths.pop() + self.resolver_prefix_paths.pop() + + def check_resolver_prefix(self, depth, path, kind, + current_node, current_index): + node_check, index_check = path[depth-1] + if isinstance(node_check, str): + if current_node.tag != node_check: + return + elif node_check is not None: + if not isinstance(current_node, node_check): + return + if index_check is True and current_index is not None: + return + if (index_check is False or index_check is None) \ + and current_index is None: + return + if isinstance(index_check, str): + if not (isinstance(current_index, ScalarNode) + and index_check == current_index.value): + return + elif isinstance(index_check, int) and not isinstance(index_check, bool): + if index_check != current_index: + return + return True + + def resolve(self, kind, value, implicit): + if kind is ScalarNode and implicit[0]: + if value == '': + resolvers = self.yaml_implicit_resolvers.get('', []) + else: + resolvers = self.yaml_implicit_resolvers.get(value[0], []) + resolvers += self.yaml_implicit_resolvers.get(None, []) + for tag, regexp in resolvers: + if regexp.match(value): + return tag + implicit = implicit[1] + if self.yaml_path_resolvers: + exact_paths = self.resolver_exact_paths[-1] + if kind in exact_paths: + return exact_paths[kind] + if None in exact_paths: + return exact_paths[None] + if kind is ScalarNode: + return self.DEFAULT_SCALAR_TAG + elif kind is SequenceNode: + return self.DEFAULT_SEQUENCE_TAG + elif kind is MappingNode: + return self.DEFAULT_MAPPING_TAG + +class Resolver(BaseResolver): + pass + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:bool', + re.compile(r'''^(?:yes|Yes|YES|no|No|NO + |true|True|TRUE|false|False|FALSE + |on|On|ON|off|Off|OFF)$''', re.X), + list('yYnNtTfFoO')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:float', + re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)? + |\.[0-9_]+(?:[eE][-+][0-9]+)? + |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]* + |[-+]?\.(?:inf|Inf|INF) + |\.(?:nan|NaN|NAN))$''', re.X), + list('-+0123456789.')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:int', + re.compile(r'''^(?:[-+]?0b[0-1_]+ + |[-+]?0[0-7_]+ + |[-+]?(?:0|[1-9][0-9_]*) + |[-+]?0x[0-9a-fA-F_]+ + |[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$''', re.X), + list('-+0123456789')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:merge', + re.compile(r'^(?:<<)$'), + ['<']) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:null', + re.compile(r'''^(?: ~ + |null|Null|NULL + | )$''', re.X), + ['~', 'n', 'N', '']) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:timestamp', + re.compile(r'''^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] + |[0-9][0-9][0-9][0-9] -[0-9][0-9]? -[0-9][0-9]? + (?:[Tt]|[ \t]+)[0-9][0-9]? + :[0-9][0-9] :[0-9][0-9] (?:\.[0-9]*)? + (?:[ \t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$''', re.X), + list('0123456789')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:value', + re.compile(r'^(?:=)$'), + ['=']) + +# The following resolver is only for documentation purposes. It cannot work +# because plain scalars cannot start with '!', '&', or '*'. +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:yaml', + re.compile(r'^(?:!|&|\*)$'), + list('!&*')) + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/scanner.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/scanner.py new file mode 100644 index 00000000..7437ede1 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/scanner.py @@ -0,0 +1,1435 @@ + +# Scanner produces tokens of the following types: +# STREAM-START +# STREAM-END +# DIRECTIVE(name, value) +# DOCUMENT-START +# DOCUMENT-END +# BLOCK-SEQUENCE-START +# BLOCK-MAPPING-START +# BLOCK-END +# FLOW-SEQUENCE-START +# FLOW-MAPPING-START +# FLOW-SEQUENCE-END +# FLOW-MAPPING-END +# BLOCK-ENTRY +# FLOW-ENTRY +# KEY +# VALUE +# ALIAS(value) +# ANCHOR(value) +# TAG(value) +# SCALAR(value, plain, style) +# +# Read comments in the Scanner code for more details. +# + +__all__ = ['Scanner', 'ScannerError'] + +from .error import MarkedYAMLError +from .tokens import * + +class ScannerError(MarkedYAMLError): + pass + +class SimpleKey: + # See below simple keys treatment. + + def __init__(self, token_number, required, index, line, column, mark): + self.token_number = token_number + self.required = required + self.index = index + self.line = line + self.column = column + self.mark = mark + +class Scanner: + + def __init__(self): + """Initialize the scanner.""" + # It is assumed that Scanner and Reader will have a common descendant. + # Reader do the dirty work of checking for BOM and converting the + # input data to Unicode. It also adds NUL to the end. + # + # Reader supports the following methods + # self.peek(i=0) # peek the next i-th character + # self.prefix(l=1) # peek the next l characters + # self.forward(l=1) # read the next l characters and move the pointer. + + # Had we reached the end of the stream? + self.done = False + + # The number of unclosed '{' and '['. `flow_level == 0` means block + # context. + self.flow_level = 0 + + # List of processed tokens that are not yet emitted. + self.tokens = [] + + # Add the STREAM-START token. + self.fetch_stream_start() + + # Number of tokens that were emitted through the `get_token` method. + self.tokens_taken = 0 + + # The current indentation level. + self.indent = -1 + + # Past indentation levels. + self.indents = [] + + # Variables related to simple keys treatment. + + # A simple key is a key that is not denoted by the '?' indicator. + # Example of simple keys: + # --- + # block simple key: value + # ? not a simple key: + # : { flow simple key: value } + # We emit the KEY token before all keys, so when we find a potential + # simple key, we try to locate the corresponding ':' indicator. + # Simple keys should be limited to a single line and 1024 characters. + + # Can a simple key start at the current position? A simple key may + # start: + # - at the beginning of the line, not counting indentation spaces + # (in block context), + # - after '{', '[', ',' (in the flow context), + # - after '?', ':', '-' (in the block context). + # In the block context, this flag also signifies if a block collection + # may start at the current position. + self.allow_simple_key = True + + # Keep track of possible simple keys. This is a dictionary. The key + # is `flow_level`; there can be no more that one possible simple key + # for each level. The value is a SimpleKey record: + # (token_number, required, index, line, column, mark) + # A simple key may start with ALIAS, ANCHOR, TAG, SCALAR(flow), + # '[', or '{' tokens. + self.possible_simple_keys = {} + + # Public methods. + + def check_token(self, *choices): + # Check if the next token is one of the given types. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + if not choices: + return True + for choice in choices: + if isinstance(self.tokens[0], choice): + return True + return False + + def peek_token(self): + # Return the next token, but do not delete if from the queue. + # Return None if no more tokens. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + return self.tokens[0] + else: + return None + + def get_token(self): + # Return the next token. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + self.tokens_taken += 1 + return self.tokens.pop(0) + + # Private methods. + + def need_more_tokens(self): + if self.done: + return False + if not self.tokens: + return True + # The current token may be a potential simple key, so we + # need to look further. + self.stale_possible_simple_keys() + if self.next_possible_simple_key() == self.tokens_taken: + return True + + def fetch_more_tokens(self): + + # Eat whitespaces and comments until we reach the next token. + self.scan_to_next_token() + + # Remove obsolete possible simple keys. + self.stale_possible_simple_keys() + + # Compare the current indentation and column. It may add some tokens + # and decrease the current indentation level. + self.unwind_indent(self.column) + + # Peek the next character. + ch = self.peek() + + # Is it the end of stream? + if ch == '\0': + return self.fetch_stream_end() + + # Is it a directive? + if ch == '%' and self.check_directive(): + return self.fetch_directive() + + # Is it the document start? + if ch == '-' and self.check_document_start(): + return self.fetch_document_start() + + # Is it the document end? + if ch == '.' and self.check_document_end(): + return self.fetch_document_end() + + # TODO: support for BOM within a stream. + #if ch == '\uFEFF': + # return self.fetch_bom() <-- issue BOMToken + + # Note: the order of the following checks is NOT significant. + + # Is it the flow sequence start indicator? + if ch == '[': + return self.fetch_flow_sequence_start() + + # Is it the flow mapping start indicator? + if ch == '{': + return self.fetch_flow_mapping_start() + + # Is it the flow sequence end indicator? + if ch == ']': + return self.fetch_flow_sequence_end() + + # Is it the flow mapping end indicator? + if ch == '}': + return self.fetch_flow_mapping_end() + + # Is it the flow entry indicator? + if ch == ',': + return self.fetch_flow_entry() + + # Is it the block entry indicator? + if ch == '-' and self.check_block_entry(): + return self.fetch_block_entry() + + # Is it the key indicator? + if ch == '?' and self.check_key(): + return self.fetch_key() + + # Is it the value indicator? + if ch == ':' and self.check_value(): + return self.fetch_value() + + # Is it an alias? + if ch == '*': + return self.fetch_alias() + + # Is it an anchor? + if ch == '&': + return self.fetch_anchor() + + # Is it a tag? + if ch == '!': + return self.fetch_tag() + + # Is it a literal scalar? + if ch == '|' and not self.flow_level: + return self.fetch_literal() + + # Is it a folded scalar? + if ch == '>' and not self.flow_level: + return self.fetch_folded() + + # Is it a single quoted scalar? + if ch == '\'': + return self.fetch_single() + + # Is it a double quoted scalar? + if ch == '\"': + return self.fetch_double() + + # It must be a plain scalar then. + if self.check_plain(): + return self.fetch_plain() + + # No? It's an error. Let's produce a nice error message. + raise ScannerError("while scanning for the next token", None, + "found character %r that cannot start any token" % ch, + self.get_mark()) + + # Simple keys treatment. + + def next_possible_simple_key(self): + # Return the number of the nearest possible simple key. Actually we + # don't need to loop through the whole dictionary. We may replace it + # with the following code: + # if not self.possible_simple_keys: + # return None + # return self.possible_simple_keys[ + # min(self.possible_simple_keys.keys())].token_number + min_token_number = None + for level in self.possible_simple_keys: + key = self.possible_simple_keys[level] + if min_token_number is None or key.token_number < min_token_number: + min_token_number = key.token_number + return min_token_number + + def stale_possible_simple_keys(self): + # Remove entries that are no longer possible simple keys. According to + # the YAML specification, simple keys + # - should be limited to a single line, + # - should be no longer than 1024 characters. + # Disabling this procedure will allow simple keys of any length and + # height (may cause problems if indentation is broken though). + for level in list(self.possible_simple_keys): + key = self.possible_simple_keys[level] + if key.line != self.line \ + or self.index-key.index > 1024: + if key.required: + raise ScannerError("while scanning a simple key", key.mark, + "could not find expected ':'", self.get_mark()) + del self.possible_simple_keys[level] + + def save_possible_simple_key(self): + # The next token may start a simple key. We check if it's possible + # and save its position. This function is called for + # ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'. + + # Check if a simple key is required at the current position. + required = not self.flow_level and self.indent == self.column + + # The next token might be a simple key. Let's save it's number and + # position. + if self.allow_simple_key: + self.remove_possible_simple_key() + token_number = self.tokens_taken+len(self.tokens) + key = SimpleKey(token_number, required, + self.index, self.line, self.column, self.get_mark()) + self.possible_simple_keys[self.flow_level] = key + + def remove_possible_simple_key(self): + # Remove the saved possible key position at the current flow level. + if self.flow_level in self.possible_simple_keys: + key = self.possible_simple_keys[self.flow_level] + + if key.required: + raise ScannerError("while scanning a simple key", key.mark, + "could not find expected ':'", self.get_mark()) + + del self.possible_simple_keys[self.flow_level] + + # Indentation functions. + + def unwind_indent(self, column): + + ## In flow context, tokens should respect indentation. + ## Actually the condition should be `self.indent >= column` according to + ## the spec. But this condition will prohibit intuitively correct + ## constructions such as + ## key : { + ## } + #if self.flow_level and self.indent > column: + # raise ScannerError(None, None, + # "invalid indentation or unclosed '[' or '{'", + # self.get_mark()) + + # In the flow context, indentation is ignored. We make the scanner less + # restrictive then specification requires. + if self.flow_level: + return + + # In block context, we may need to issue the BLOCK-END tokens. + while self.indent > column: + mark = self.get_mark() + self.indent = self.indents.pop() + self.tokens.append(BlockEndToken(mark, mark)) + + def add_indent(self, column): + # Check if we need to increase indentation. + if self.indent < column: + self.indents.append(self.indent) + self.indent = column + return True + return False + + # Fetchers. + + def fetch_stream_start(self): + # We always add STREAM-START as the first token and STREAM-END as the + # last token. + + # Read the token. + mark = self.get_mark() + + # Add STREAM-START. + self.tokens.append(StreamStartToken(mark, mark, + encoding=self.encoding)) + + + def fetch_stream_end(self): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. + self.remove_possible_simple_key() + self.allow_simple_key = False + self.possible_simple_keys = {} + + # Read the token. + mark = self.get_mark() + + # Add STREAM-END. + self.tokens.append(StreamEndToken(mark, mark)) + + # The steam is finished. + self.done = True + + def fetch_directive(self): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. + self.remove_possible_simple_key() + self.allow_simple_key = False + + # Scan and add DIRECTIVE. + self.tokens.append(self.scan_directive()) + + def fetch_document_start(self): + self.fetch_document_indicator(DocumentStartToken) + + def fetch_document_end(self): + self.fetch_document_indicator(DocumentEndToken) + + def fetch_document_indicator(self, TokenClass): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. Note that there could not be a block collection + # after '---'. + self.remove_possible_simple_key() + self.allow_simple_key = False + + # Add DOCUMENT-START or DOCUMENT-END. + start_mark = self.get_mark() + self.forward(3) + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_sequence_start(self): + self.fetch_flow_collection_start(FlowSequenceStartToken) + + def fetch_flow_mapping_start(self): + self.fetch_flow_collection_start(FlowMappingStartToken) + + def fetch_flow_collection_start(self, TokenClass): + + # '[' and '{' may start a simple key. + self.save_possible_simple_key() + + # Increase the flow level. + self.flow_level += 1 + + # Simple keys are allowed after '[' and '{'. + self.allow_simple_key = True + + # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_sequence_end(self): + self.fetch_flow_collection_end(FlowSequenceEndToken) + + def fetch_flow_mapping_end(self): + self.fetch_flow_collection_end(FlowMappingEndToken) + + def fetch_flow_collection_end(self, TokenClass): + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Decrease the flow level. + self.flow_level -= 1 + + # No simple keys after ']' or '}'. + self.allow_simple_key = False + + # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_entry(self): + + # Simple keys are allowed after ','. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add FLOW-ENTRY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(FlowEntryToken(start_mark, end_mark)) + + def fetch_block_entry(self): + + # Block context needs additional checks. + if not self.flow_level: + + # Are we allowed to start a new entry? + if not self.allow_simple_key: + raise ScannerError(None, None, + "sequence entries are not allowed here", + self.get_mark()) + + # We may need to add BLOCK-SEQUENCE-START. + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockSequenceStartToken(mark, mark)) + + # It's an error for the block entry to occur in the flow context, + # but we let the parser detect this. + else: + pass + + # Simple keys are allowed after '-'. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add BLOCK-ENTRY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(BlockEntryToken(start_mark, end_mark)) + + def fetch_key(self): + + # Block context needs additional checks. + if not self.flow_level: + + # Are we allowed to start a key (not necessary a simple)? + if not self.allow_simple_key: + raise ScannerError(None, None, + "mapping keys are not allowed here", + self.get_mark()) + + # We may need to add BLOCK-MAPPING-START. + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockMappingStartToken(mark, mark)) + + # Simple keys are allowed after '?' in the block context. + self.allow_simple_key = not self.flow_level + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add KEY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(KeyToken(start_mark, end_mark)) + + def fetch_value(self): + + # Do we determine a simple key? + if self.flow_level in self.possible_simple_keys: + + # Add KEY. + key = self.possible_simple_keys[self.flow_level] + del self.possible_simple_keys[self.flow_level] + self.tokens.insert(key.token_number-self.tokens_taken, + KeyToken(key.mark, key.mark)) + + # If this key starts a new block mapping, we need to add + # BLOCK-MAPPING-START. + if not self.flow_level: + if self.add_indent(key.column): + self.tokens.insert(key.token_number-self.tokens_taken, + BlockMappingStartToken(key.mark, key.mark)) + + # There cannot be two simple keys one after another. + self.allow_simple_key = False + + # It must be a part of a complex key. + else: + + # Block context needs additional checks. + # (Do we really need them? They will be caught by the parser + # anyway.) + if not self.flow_level: + + # We are allowed to start a complex value if and only if + # we can start a simple key. + if not self.allow_simple_key: + raise ScannerError(None, None, + "mapping values are not allowed here", + self.get_mark()) + + # If this value starts a new block mapping, we need to add + # BLOCK-MAPPING-START. It will be detected as an error later by + # the parser. + if not self.flow_level: + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockMappingStartToken(mark, mark)) + + # Simple keys are allowed after ':' in the block context. + self.allow_simple_key = not self.flow_level + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add VALUE. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(ValueToken(start_mark, end_mark)) + + def fetch_alias(self): + + # ALIAS could be a simple key. + self.save_possible_simple_key() + + # No simple keys after ALIAS. + self.allow_simple_key = False + + # Scan and add ALIAS. + self.tokens.append(self.scan_anchor(AliasToken)) + + def fetch_anchor(self): + + # ANCHOR could start a simple key. + self.save_possible_simple_key() + + # No simple keys after ANCHOR. + self.allow_simple_key = False + + # Scan and add ANCHOR. + self.tokens.append(self.scan_anchor(AnchorToken)) + + def fetch_tag(self): + + # TAG could start a simple key. + self.save_possible_simple_key() + + # No simple keys after TAG. + self.allow_simple_key = False + + # Scan and add TAG. + self.tokens.append(self.scan_tag()) + + def fetch_literal(self): + self.fetch_block_scalar(style='|') + + def fetch_folded(self): + self.fetch_block_scalar(style='>') + + def fetch_block_scalar(self, style): + + # A simple key may follow a block scalar. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Scan and add SCALAR. + self.tokens.append(self.scan_block_scalar(style)) + + def fetch_single(self): + self.fetch_flow_scalar(style='\'') + + def fetch_double(self): + self.fetch_flow_scalar(style='"') + + def fetch_flow_scalar(self, style): + + # A flow scalar could be a simple key. + self.save_possible_simple_key() + + # No simple keys after flow scalars. + self.allow_simple_key = False + + # Scan and add SCALAR. + self.tokens.append(self.scan_flow_scalar(style)) + + def fetch_plain(self): + + # A plain scalar could be a simple key. + self.save_possible_simple_key() + + # No simple keys after plain scalars. But note that `scan_plain` will + # change this flag if the scan is finished at the beginning of the + # line. + self.allow_simple_key = False + + # Scan and add SCALAR. May change `allow_simple_key`. + self.tokens.append(self.scan_plain()) + + # Checkers. + + def check_directive(self): + + # DIRECTIVE: ^ '%' ... + # The '%' indicator is already checked. + if self.column == 0: + return True + + def check_document_start(self): + + # DOCUMENT-START: ^ '---' (' '|'\n') + if self.column == 0: + if self.prefix(3) == '---' \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return True + + def check_document_end(self): + + # DOCUMENT-END: ^ '...' (' '|'\n') + if self.column == 0: + if self.prefix(3) == '...' \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return True + + def check_block_entry(self): + + # BLOCK-ENTRY: '-' (' '|'\n') + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_key(self): + + # KEY(flow context): '?' + if self.flow_level: + return True + + # KEY(block context): '?' (' '|'\n') + else: + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_value(self): + + # VALUE(flow context): ':' + if self.flow_level: + return True + + # VALUE(block context): ':' (' '|'\n') + else: + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_plain(self): + + # A plain scalar may start with any non-space character except: + # '-', '?', ':', ',', '[', ']', '{', '}', + # '#', '&', '*', '!', '|', '>', '\'', '\"', + # '%', '@', '`'. + # + # It may also start with + # '-', '?', ':' + # if it is followed by a non-space character. + # + # Note that we limit the last rule to the block context (except the + # '-' character) because we want the flow context to be space + # independent. + ch = self.peek() + return ch not in '\0 \t\r\n\x85\u2028\u2029-?:,[]{}#&*!|>\'\"%@`' \ + or (self.peek(1) not in '\0 \t\r\n\x85\u2028\u2029' + and (ch == '-' or (not self.flow_level and ch in '?:'))) + + # Scanners. + + def scan_to_next_token(self): + # We ignore spaces, line breaks and comments. + # If we find a line break in the block context, we set the flag + # `allow_simple_key` on. + # The byte order mark is stripped if it's the first character in the + # stream. We do not yet support BOM inside the stream as the + # specification requires. Any such mark will be considered as a part + # of the document. + # + # TODO: We need to make tab handling rules more sane. A good rule is + # Tabs cannot precede tokens + # BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END, + # KEY(block), VALUE(block), BLOCK-ENTRY + # So the checking code is + # if : + # self.allow_simple_keys = False + # We also need to add the check for `allow_simple_keys == True` to + # `unwind_indent` before issuing BLOCK-END. + # Scanners for block, flow, and plain scalars need to be modified. + + if self.index == 0 and self.peek() == '\uFEFF': + self.forward() + found = False + while not found: + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + if self.scan_line_break(): + if not self.flow_level: + self.allow_simple_key = True + else: + found = True + + def scan_directive(self): + # See the specification for details. + start_mark = self.get_mark() + self.forward() + name = self.scan_directive_name(start_mark) + value = None + if name == 'YAML': + value = self.scan_yaml_directive_value(start_mark) + end_mark = self.get_mark() + elif name == 'TAG': + value = self.scan_tag_directive_value(start_mark) + end_mark = self.get_mark() + else: + end_mark = self.get_mark() + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + self.scan_directive_ignored_line(start_mark) + return DirectiveToken(name, value, start_mark, end_mark) + + def scan_directive_name(self, start_mark): + # See the specification for details. + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if not length: + raise ScannerError("while scanning a directive", start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + value = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + return value + + def scan_yaml_directive_value(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + major = self.scan_yaml_directive_number(start_mark) + if self.peek() != '.': + raise ScannerError("while scanning a directive", start_mark, + "expected a digit or '.', but found %r" % self.peek(), + self.get_mark()) + self.forward() + minor = self.scan_yaml_directive_number(start_mark) + if self.peek() not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected a digit or ' ', but found %r" % self.peek(), + self.get_mark()) + return (major, minor) + + def scan_yaml_directive_number(self, start_mark): + # See the specification for details. + ch = self.peek() + if not ('0' <= ch <= '9'): + raise ScannerError("while scanning a directive", start_mark, + "expected a digit, but found %r" % ch, self.get_mark()) + length = 0 + while '0' <= self.peek(length) <= '9': + length += 1 + value = int(self.prefix(length)) + self.forward(length) + return value + + def scan_tag_directive_value(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + handle = self.scan_tag_directive_handle(start_mark) + while self.peek() == ' ': + self.forward() + prefix = self.scan_tag_directive_prefix(start_mark) + return (handle, prefix) + + def scan_tag_directive_handle(self, start_mark): + # See the specification for details. + value = self.scan_tag_handle('directive', start_mark) + ch = self.peek() + if ch != ' ': + raise ScannerError("while scanning a directive", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + return value + + def scan_tag_directive_prefix(self, start_mark): + # See the specification for details. + value = self.scan_tag_uri('directive', start_mark) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + return value + + def scan_directive_ignored_line(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + ch = self.peek() + if ch not in '\0\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected a comment or a line break, but found %r" + % ch, self.get_mark()) + self.scan_line_break() + + def scan_anchor(self, TokenClass): + # The specification does not restrict characters for anchors and + # aliases. This may lead to problems, for instance, the document: + # [ *alias, value ] + # can be interpreted in two ways, as + # [ "value" ] + # and + # [ *alias , "value" ] + # Therefore we restrict aliases to numbers and ASCII letters. + start_mark = self.get_mark() + indicator = self.peek() + if indicator == '*': + name = 'alias' + else: + name = 'anchor' + self.forward() + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if not length: + raise ScannerError("while scanning an %s" % name, start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + value = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch not in '\0 \t\r\n\x85\u2028\u2029?:,]}%@`': + raise ScannerError("while scanning an %s" % name, start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + end_mark = self.get_mark() + return TokenClass(value, start_mark, end_mark) + + def scan_tag(self): + # See the specification for details. + start_mark = self.get_mark() + ch = self.peek(1) + if ch == '<': + handle = None + self.forward(2) + suffix = self.scan_tag_uri('tag', start_mark) + if self.peek() != '>': + raise ScannerError("while parsing a tag", start_mark, + "expected '>', but found %r" % self.peek(), + self.get_mark()) + self.forward() + elif ch in '\0 \t\r\n\x85\u2028\u2029': + handle = None + suffix = '!' + self.forward() + else: + length = 1 + use_handle = False + while ch not in '\0 \r\n\x85\u2028\u2029': + if ch == '!': + use_handle = True + break + length += 1 + ch = self.peek(length) + handle = '!' + if use_handle: + handle = self.scan_tag_handle('tag', start_mark) + else: + handle = '!' + self.forward() + suffix = self.scan_tag_uri('tag', start_mark) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a tag", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + value = (handle, suffix) + end_mark = self.get_mark() + return TagToken(value, start_mark, end_mark) + + def scan_block_scalar(self, style): + # See the specification for details. + + if style == '>': + folded = True + else: + folded = False + + chunks = [] + start_mark = self.get_mark() + + # Scan the header. + self.forward() + chomping, increment = self.scan_block_scalar_indicators(start_mark) + self.scan_block_scalar_ignored_line(start_mark) + + # Determine the indentation level and go to the first non-empty line. + min_indent = self.indent+1 + if min_indent < 1: + min_indent = 1 + if increment is None: + breaks, max_indent, end_mark = self.scan_block_scalar_indentation() + indent = max(min_indent, max_indent) + else: + indent = min_indent+increment-1 + breaks, end_mark = self.scan_block_scalar_breaks(indent) + line_break = '' + + # Scan the inner part of the block scalar. + while self.column == indent and self.peek() != '\0': + chunks.extend(breaks) + leading_non_space = self.peek() not in ' \t' + length = 0 + while self.peek(length) not in '\0\r\n\x85\u2028\u2029': + length += 1 + chunks.append(self.prefix(length)) + self.forward(length) + line_break = self.scan_line_break() + breaks, end_mark = self.scan_block_scalar_breaks(indent) + if self.column == indent and self.peek() != '\0': + + # Unfortunately, folding rules are ambiguous. + # + # This is the folding according to the specification: + + if folded and line_break == '\n' \ + and leading_non_space and self.peek() not in ' \t': + if not breaks: + chunks.append(' ') + else: + chunks.append(line_break) + + # This is Clark Evans's interpretation (also in the spec + # examples): + # + #if folded and line_break == '\n': + # if not breaks: + # if self.peek() not in ' \t': + # chunks.append(' ') + # else: + # chunks.append(line_break) + #else: + # chunks.append(line_break) + else: + break + + # Chomp the tail. + if chomping is not False: + chunks.append(line_break) + if chomping is True: + chunks.extend(breaks) + + # We are done. + return ScalarToken(''.join(chunks), False, start_mark, end_mark, + style) + + def scan_block_scalar_indicators(self, start_mark): + # See the specification for details. + chomping = None + increment = None + ch = self.peek() + if ch in '+-': + if ch == '+': + chomping = True + else: + chomping = False + self.forward() + ch = self.peek() + if ch in '0123456789': + increment = int(ch) + if increment == 0: + raise ScannerError("while scanning a block scalar", start_mark, + "expected indentation indicator in the range 1-9, but found 0", + self.get_mark()) + self.forward() + elif ch in '0123456789': + increment = int(ch) + if increment == 0: + raise ScannerError("while scanning a block scalar", start_mark, + "expected indentation indicator in the range 1-9, but found 0", + self.get_mark()) + self.forward() + ch = self.peek() + if ch in '+-': + if ch == '+': + chomping = True + else: + chomping = False + self.forward() + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a block scalar", start_mark, + "expected chomping or indentation indicators, but found %r" + % ch, self.get_mark()) + return chomping, increment + + def scan_block_scalar_ignored_line(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + ch = self.peek() + if ch not in '\0\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a block scalar", start_mark, + "expected a comment or a line break, but found %r" % ch, + self.get_mark()) + self.scan_line_break() + + def scan_block_scalar_indentation(self): + # See the specification for details. + chunks = [] + max_indent = 0 + end_mark = self.get_mark() + while self.peek() in ' \r\n\x85\u2028\u2029': + if self.peek() != ' ': + chunks.append(self.scan_line_break()) + end_mark = self.get_mark() + else: + self.forward() + if self.column > max_indent: + max_indent = self.column + return chunks, max_indent, end_mark + + def scan_block_scalar_breaks(self, indent): + # See the specification for details. + chunks = [] + end_mark = self.get_mark() + while self.column < indent and self.peek() == ' ': + self.forward() + while self.peek() in '\r\n\x85\u2028\u2029': + chunks.append(self.scan_line_break()) + end_mark = self.get_mark() + while self.column < indent and self.peek() == ' ': + self.forward() + return chunks, end_mark + + def scan_flow_scalar(self, style): + # See the specification for details. + # Note that we loose indentation rules for quoted scalars. Quoted + # scalars don't need to adhere indentation because " and ' clearly + # mark the beginning and the end of them. Therefore we are less + # restrictive then the specification requires. We only need to check + # that document separators are not included in scalars. + if style == '"': + double = True + else: + double = False + chunks = [] + start_mark = self.get_mark() + quote = self.peek() + self.forward() + chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark)) + while self.peek() != quote: + chunks.extend(self.scan_flow_scalar_spaces(double, start_mark)) + chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark)) + self.forward() + end_mark = self.get_mark() + return ScalarToken(''.join(chunks), False, start_mark, end_mark, + style) + + ESCAPE_REPLACEMENTS = { + '0': '\0', + 'a': '\x07', + 'b': '\x08', + 't': '\x09', + '\t': '\x09', + 'n': '\x0A', + 'v': '\x0B', + 'f': '\x0C', + 'r': '\x0D', + 'e': '\x1B', + ' ': '\x20', + '\"': '\"', + '\\': '\\', + '/': '/', + 'N': '\x85', + '_': '\xA0', + 'L': '\u2028', + 'P': '\u2029', + } + + ESCAPE_CODES = { + 'x': 2, + 'u': 4, + 'U': 8, + } + + def scan_flow_scalar_non_spaces(self, double, start_mark): + # See the specification for details. + chunks = [] + while True: + length = 0 + while self.peek(length) not in '\'\"\\\0 \t\r\n\x85\u2028\u2029': + length += 1 + if length: + chunks.append(self.prefix(length)) + self.forward(length) + ch = self.peek() + if not double and ch == '\'' and self.peek(1) == '\'': + chunks.append('\'') + self.forward(2) + elif (double and ch == '\'') or (not double and ch in '\"\\'): + chunks.append(ch) + self.forward() + elif double and ch == '\\': + self.forward() + ch = self.peek() + if ch in self.ESCAPE_REPLACEMENTS: + chunks.append(self.ESCAPE_REPLACEMENTS[ch]) + self.forward() + elif ch in self.ESCAPE_CODES: + length = self.ESCAPE_CODES[ch] + self.forward() + for k in range(length): + if self.peek(k) not in '0123456789ABCDEFabcdef': + raise ScannerError("while scanning a double-quoted scalar", start_mark, + "expected escape sequence of %d hexdecimal numbers, but found %r" % + (length, self.peek(k)), self.get_mark()) + code = int(self.prefix(length), 16) + chunks.append(chr(code)) + self.forward(length) + elif ch in '\r\n\x85\u2028\u2029': + self.scan_line_break() + chunks.extend(self.scan_flow_scalar_breaks(double, start_mark)) + else: + raise ScannerError("while scanning a double-quoted scalar", start_mark, + "found unknown escape character %r" % ch, self.get_mark()) + else: + return chunks + + def scan_flow_scalar_spaces(self, double, start_mark): + # See the specification for details. + chunks = [] + length = 0 + while self.peek(length) in ' \t': + length += 1 + whitespaces = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch == '\0': + raise ScannerError("while scanning a quoted scalar", start_mark, + "found unexpected end of stream", self.get_mark()) + elif ch in '\r\n\x85\u2028\u2029': + line_break = self.scan_line_break() + breaks = self.scan_flow_scalar_breaks(double, start_mark) + if line_break != '\n': + chunks.append(line_break) + elif not breaks: + chunks.append(' ') + chunks.extend(breaks) + else: + chunks.append(whitespaces) + return chunks + + def scan_flow_scalar_breaks(self, double, start_mark): + # See the specification for details. + chunks = [] + while True: + # Instead of checking indentation, we check for document + # separators. + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a quoted scalar", start_mark, + "found unexpected document separator", self.get_mark()) + while self.peek() in ' \t': + self.forward() + if self.peek() in '\r\n\x85\u2028\u2029': + chunks.append(self.scan_line_break()) + else: + return chunks + + def scan_plain(self): + # See the specification for details. + # We add an additional restriction for the flow context: + # plain scalars in the flow context cannot contain ',' or '?'. + # We also keep track of the `allow_simple_key` flag here. + # Indentation rules are loosed for the flow context. + chunks = [] + start_mark = self.get_mark() + end_mark = start_mark + indent = self.indent+1 + # We allow zero indentation for scalars, but then we need to check for + # document separators at the beginning of the line. + #if indent == 0: + # indent = 1 + spaces = [] + while True: + length = 0 + if self.peek() == '#': + break + while True: + ch = self.peek(length) + if ch in '\0 \t\r\n\x85\u2028\u2029' \ + or (ch == ':' and + self.peek(length+1) in '\0 \t\r\n\x85\u2028\u2029' + + (u',[]{}' if self.flow_level else u''))\ + or (self.flow_level and ch in ',?[]{}'): + break + length += 1 + if length == 0: + break + self.allow_simple_key = False + chunks.extend(spaces) + chunks.append(self.prefix(length)) + self.forward(length) + end_mark = self.get_mark() + spaces = self.scan_plain_spaces(indent, start_mark) + if not spaces or self.peek() == '#' \ + or (not self.flow_level and self.column < indent): + break + return ScalarToken(''.join(chunks), True, start_mark, end_mark) + + def scan_plain_spaces(self, indent, start_mark): + # See the specification for details. + # The specification is really confusing about tabs in plain scalars. + # We just forbid them completely. Do not use tabs in YAML! + chunks = [] + length = 0 + while self.peek(length) in ' ': + length += 1 + whitespaces = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch in '\r\n\x85\u2028\u2029': + line_break = self.scan_line_break() + self.allow_simple_key = True + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return + breaks = [] + while self.peek() in ' \r\n\x85\u2028\u2029': + if self.peek() == ' ': + self.forward() + else: + breaks.append(self.scan_line_break()) + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return + if line_break != '\n': + chunks.append(line_break) + elif not breaks: + chunks.append(' ') + chunks.extend(breaks) + elif whitespaces: + chunks.append(whitespaces) + return chunks + + def scan_tag_handle(self, name, start_mark): + # See the specification for details. + # For some strange reasons, the specification does not allow '_' in + # tag handles. I have allowed it anyway. + ch = self.peek() + if ch != '!': + raise ScannerError("while scanning a %s" % name, start_mark, + "expected '!', but found %r" % ch, self.get_mark()) + length = 1 + ch = self.peek(length) + if ch != ' ': + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if ch != '!': + self.forward(length) + raise ScannerError("while scanning a %s" % name, start_mark, + "expected '!', but found %r" % ch, self.get_mark()) + length += 1 + value = self.prefix(length) + self.forward(length) + return value + + def scan_tag_uri(self, name, start_mark): + # See the specification for details. + # Note: we do not check if URI is well-formed. + chunks = [] + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?:@&=+$,_.!~*\'()[]%': + if ch == '%': + chunks.append(self.prefix(length)) + self.forward(length) + length = 0 + chunks.append(self.scan_uri_escapes(name, start_mark)) + else: + length += 1 + ch = self.peek(length) + if length: + chunks.append(self.prefix(length)) + self.forward(length) + length = 0 + if not chunks: + raise ScannerError("while parsing a %s" % name, start_mark, + "expected URI, but found %r" % ch, self.get_mark()) + return ''.join(chunks) + + def scan_uri_escapes(self, name, start_mark): + # See the specification for details. + codes = [] + mark = self.get_mark() + while self.peek() == '%': + self.forward() + for k in range(2): + if self.peek(k) not in '0123456789ABCDEFabcdef': + raise ScannerError("while scanning a %s" % name, start_mark, + "expected URI escape sequence of 2 hexdecimal numbers, but found %r" + % self.peek(k), self.get_mark()) + codes.append(int(self.prefix(2), 16)) + self.forward(2) + try: + value = bytes(codes).decode('utf-8') + except UnicodeDecodeError as exc: + raise ScannerError("while scanning a %s" % name, start_mark, str(exc), mark) + return value + + def scan_line_break(self): + # Transforms: + # '\r\n' : '\n' + # '\r' : '\n' + # '\n' : '\n' + # '\x85' : '\n' + # '\u2028' : '\u2028' + # '\u2029 : '\u2029' + # default : '' + ch = self.peek() + if ch in '\r\n\x85': + if self.prefix(2) == '\r\n': + self.forward(2) + else: + self.forward() + return '\n' + elif ch in '\u2028\u2029': + self.forward() + return ch + return '' diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/serializer.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/serializer.py new file mode 100644 index 00000000..fe911e67 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/serializer.py @@ -0,0 +1,111 @@ + +__all__ = ['Serializer', 'SerializerError'] + +from .error import YAMLError +from .events import * +from .nodes import * + +class SerializerError(YAMLError): + pass + +class Serializer: + + ANCHOR_TEMPLATE = 'id%03d' + + def __init__(self, encoding=None, + explicit_start=None, explicit_end=None, version=None, tags=None): + self.use_encoding = encoding + self.use_explicit_start = explicit_start + self.use_explicit_end = explicit_end + self.use_version = version + self.use_tags = tags + self.serialized_nodes = {} + self.anchors = {} + self.last_anchor_id = 0 + self.closed = None + + def open(self): + if self.closed is None: + self.emit(StreamStartEvent(encoding=self.use_encoding)) + self.closed = False + elif self.closed: + raise SerializerError("serializer is closed") + else: + raise SerializerError("serializer is already opened") + + def close(self): + if self.closed is None: + raise SerializerError("serializer is not opened") + elif not self.closed: + self.emit(StreamEndEvent()) + self.closed = True + + #def __del__(self): + # self.close() + + def serialize(self, node): + if self.closed is None: + raise SerializerError("serializer is not opened") + elif self.closed: + raise SerializerError("serializer is closed") + self.emit(DocumentStartEvent(explicit=self.use_explicit_start, + version=self.use_version, tags=self.use_tags)) + self.anchor_node(node) + self.serialize_node(node, None, None) + self.emit(DocumentEndEvent(explicit=self.use_explicit_end)) + self.serialized_nodes = {} + self.anchors = {} + self.last_anchor_id = 0 + + def anchor_node(self, node): + if node in self.anchors: + if self.anchors[node] is None: + self.anchors[node] = self.generate_anchor(node) + else: + self.anchors[node] = None + if isinstance(node, SequenceNode): + for item in node.value: + self.anchor_node(item) + elif isinstance(node, MappingNode): + for key, value in node.value: + self.anchor_node(key) + self.anchor_node(value) + + def generate_anchor(self, node): + self.last_anchor_id += 1 + return self.ANCHOR_TEMPLATE % self.last_anchor_id + + def serialize_node(self, node, parent, index): + alias = self.anchors[node] + if node in self.serialized_nodes: + self.emit(AliasEvent(alias)) + else: + self.serialized_nodes[node] = True + self.descend_resolver(parent, index) + if isinstance(node, ScalarNode): + detected_tag = self.resolve(ScalarNode, node.value, (True, False)) + default_tag = self.resolve(ScalarNode, node.value, (False, True)) + implicit = (node.tag == detected_tag), (node.tag == default_tag) + self.emit(ScalarEvent(alias, node.tag, implicit, node.value, + style=node.style)) + elif isinstance(node, SequenceNode): + implicit = (node.tag + == self.resolve(SequenceNode, node.value, True)) + self.emit(SequenceStartEvent(alias, node.tag, implicit, + flow_style=node.flow_style)) + index = 0 + for item in node.value: + self.serialize_node(item, node, index) + index += 1 + self.emit(SequenceEndEvent()) + elif isinstance(node, MappingNode): + implicit = (node.tag + == self.resolve(MappingNode, node.value, True)) + self.emit(MappingStartEvent(alias, node.tag, implicit, + flow_style=node.flow_style)) + for key, value in node.value: + self.serialize_node(key, node, None) + self.serialize_node(value, node, key) + self.emit(MappingEndEvent()) + self.ascend_resolver() + diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/tokens.py b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/tokens.py new file mode 100644 index 00000000..4d0b48a3 --- /dev/null +++ b/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/yaml/tokens.py @@ -0,0 +1,104 @@ + +class Token(object): + def __init__(self, start_mark, end_mark): + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + attributes = [key for key in self.__dict__ + if not key.endswith('_mark')] + attributes.sort() + arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) + for key in attributes]) + return '%s(%s)' % (self.__class__.__name__, arguments) + +#class BOMToken(Token): +# id = '' + +class DirectiveToken(Token): + id = '' + def __init__(self, name, value, start_mark, end_mark): + self.name = name + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class DocumentStartToken(Token): + id = '' + +class DocumentEndToken(Token): + id = '' + +class StreamStartToken(Token): + id = '' + def __init__(self, start_mark=None, end_mark=None, + encoding=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.encoding = encoding + +class StreamEndToken(Token): + id = '' + +class BlockSequenceStartToken(Token): + id = '' + +class BlockMappingStartToken(Token): + id = '' + +class BlockEndToken(Token): + id = '' + +class FlowSequenceStartToken(Token): + id = '[' + +class FlowMappingStartToken(Token): + id = '{' + +class FlowSequenceEndToken(Token): + id = ']' + +class FlowMappingEndToken(Token): + id = '}' + +class KeyToken(Token): + id = '?' + +class ValueToken(Token): + id = ':' + +class BlockEntryToken(Token): + id = '-' + +class FlowEntryToken(Token): + id = ',' + +class AliasToken(Token): + id = '' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class AnchorToken(Token): + id = '' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class TagToken(Token): + id = '' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class ScalarToken(Token): + id = '' + def __init__(self, value, plain, start_mark, end_mark, style=None): + self.value = value + self.plain = plain + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + diff --git a/Resources/WPy32-3720/python-3.7.2/Scripts/crypto.exe b/Resources/WPy32-3720/python-3.7.2/Scripts/crypto.exe new file mode 100644 index 0000000000000000000000000000000000000000..379dad01089ef6a88cf04533181cf02f5001ba08 GIT binary patch literal 93000 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
DtVh5-f=bIPVwOhI=UE*MTMpEWhE zEH-Xvd2U%zsXr42Gux}o3``*2i-}DzV&Q&Or}!&Y@}XpMT;QB>@$oRzplc#J^R)SV g|7otBAizUaV8e6u%+r6WI1&UqD*=ZN2afyx1@7P!SpWb4 literal 0 HcmV?d00001 diff --git a/Resources/WPy32-3720/python-3.7.2/Scripts/decrypto.exe b/Resources/WPy32-3720/python-3.7.2/Scripts/decrypto.exe new file mode 100644 index 0000000000000000000000000000000000000000..c77bf612315aa0d3d1c537832f6595e947d48527 GIT binary patch literal 93008 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�SsFx*Sz?NuD;LWb-NOM}TRL(T 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 literal 0 HcmV?d00001 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/__init__.py index fbef050e..e69de29b 100644 --- a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/__init__.py +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/__init__.py @@ -1,6 +0,0 @@ -__all__ = ['Cipher', 'Hash', 'Protocol', 'PublicKey', 'Util', 'Signature', - 'IO', 'Math'] - -version_info = (3, 9, '6') - -__version__ = ".".join([str(x) for x in version_info]) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/app.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/app.py new file mode 100644 index 00000000..e9302392 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/app.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# crypto +# Copyright 2015 Christopher Simpkins +# MIT license +# ------------------------------------------------------------------------------ + +# Application start + + +def main(): + import sys + import getpass + from Naked.commandline import Command + from Naked.toolshed.system import dir_exists, file_exists, list_all_files, make_path, stderr + + # ------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + # ------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + # ------------------------------------------------------------------------------------------ + # [ VALIDATION LOGIC ] - early validation of appropriate command syntax + # Test that user entered at least one argument to the executable, print usage if not + # ------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(1) + # ------------------------------------------------------------------------------------------ + # [ HELP, VERSION, USAGE LOGIC ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/crypto/settings.py file + # ------------------------------------------------------------------------------------------ + if c.help(): # User requested crypto help information + from crypto.settings import help as crypto_help + print(crypto_help) + sys.exit(0) + elif c.usage(): # User requested crypto usage information + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(0) + elif c.version(): # User requested crypto version information + from crypto.settings import app_name, major_version, minor_version, patch_version + version_display_string = app_name + ' ' + major_version + '.' + minor_version + '.' + patch_version + print(version_display_string) + sys.exit(0) + # ------------------------------------------------------------------------------------------ + # [ APPLICATION LOGIC ] + # + # ------------------------------------------------------------------------------------------ + elif c.argc > 1: + # code for multi-file processing and commands that include options + # ASCII ARMOR SWITCH + ascii_armored = False + if c.option('--armor') or c.option('-a'): + ascii_armored = True + + # MAX COMPRESS / COMPRESS ALL SWITCH + max_compress = False + if c.option('--space'): + max_compress = True + + # NO COMPRESSION SWITCH + no_compress = False + if c.option('--speed'): + no_compress = True + + # SECURE HASH DIGEST REPORT SWITCH + report_checksum = False + if c.option('--hash'): + report_checksum = True + + # TAR FOLDERS SWITCH + tar_folders = False + if c.option('--tar'): + tar_folders = True + + directory_list = [] # directory paths included in the user entered paths from the command line + tar_directory_list = [] # directories, which need to be packaged as tar archives + file_list = [] # file paths included in the user entered paths from the command line (and inside directories entered) + + # dot and .crypt file flags for exclusion testing + contained_dot_file = False + contained_crypt_file = False + + # determine if argument is an existing file or directory + for argument in c.argv: + if file_exists(argument): + if argument.endswith('.crypt'): # do not include previously encrypted files + contained_crypt_file = True + else: + file_list.append(argument) # add appropriate file paths to the file_list + elif dir_exists(argument): + directory_list.append(argument) # if it is a directory, add path to the directory_list + + # add all file paths from user specified directories to the file_list + if len(directory_list) > 0: + if not tar_folders: + for directory in directory_list: + directory_file_list = list_all_files(directory) + for contained_file in directory_file_list: + if contained_file[0] == ".": + contained_dot_file = True # change the flag + is not included in file_list intentionally (no dot files) + elif contained_file.endswith('.crypt'): + contained_crypt_file = True # change the flag + is not included in file_list intentionally (no previously encrypted files) + else: + # otherwise add to the list for encryption + contained_file_path = make_path(directory, contained_file) + file_list.append(contained_file_path) + else: + # create (uncompressed) tar archive for every targeted folder and add the resulting archive to the file_list + # do not start tar file creation, yet (!) - it is more convenient for the user to first enter the passphrase then start processing + for directory in directory_list: + directory_file_path = directory + '.tar' + tar_directory_list.append(directory) + file_list.append(directory_file_path) + + # confirm that there are files to be encrypted, if not warn user + if len(file_list) == 0: + if contained_dot_file is True or contained_crypt_file is True: + stderr("There were no files identified for encryption. crypto does not encrypt dot files or previously encrypted '.crypt' files.") + sys.exit(1) + else: + stderr("Unable to identify files for encryption") + sys.exit(1) + else: + # file_list should contain all filepaths from either user specified file paths or contained in top level of directory, encrypt them + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + + # create temporary tar-files + tar_list = [] + if len(tar_directory_list) > 0: + from crypto.library import package + tar_list = package.generate_tar_files(tar_directory_list) + for t in tar_list: + if t not in file_list: # check to confirm that the tar archive is in the list of files to encrypt + if file_exists(t): + # append the tarfile to the file_list for encryption if it was not included in the file list for encryption + file_list.append(t) + else: + stderr("There was an error with the tar archive creation. Please try again.", exit=1) + + from crypto.library.cryptor import Cryptor + the_cryptor = Cryptor(passphrase) + + # run encryption based upon any passed switches + if ascii_armored: + if max_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=True, armored=True, checksum=report_checksum) + elif no_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=True, force_compress=False, armored=True, checksum=report_checksum) + else: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=False, armored=True, checksum=report_checksum) + else: + if max_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=True, armored=False, checksum=report_checksum) + elif no_compress: + the_cryptor.encrypt_files(file_list, force_nocompress=True, force_compress=False, armored=False, checksum=report_checksum) + else: + the_cryptor.encrypt_files(file_list, force_nocompress=False, force_compress=False, armored=False, checksum=report_checksum) + + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + the_cryptor.cleanup() + + # tmp tar file removal (generated with package.generate_tar_files function above) + if len(tar_list) > 0: + from crypto.library import package + package.remove_tar_files(tar_list) + else: + # passphrases did not match, report to user and abort + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + + elif c.argc == 1: + # simple single file or directory processing with default settings + path = c.arg0 + if file_exists(path): + # it is a file, encrypt the single file with default settings + # confirm that it is not already encrypted, abort if so + if path.endswith('.crypt'): + stderr("You are attempting to encrypt an encrypted file. Please delete the .crypt file and repeat encryption with the original file if this is your intent.") + sys.exit(1) + # if passes test above, obtain passphrase from the user + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + from crypto.library.cryptor import Cryptor + the_cryptor = Cryptor(passphrase) + the_cryptor.encrypt_file(path) + the_cryptor.cleanup() + else: + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + elif dir_exists(path): + # it is a directory, encrypt all top level files with default settings + dirty_directory_file_list = list_all_files(path) + # remove dot files and previously encrypted files (with .crypt suffix) from the list of directory files + clean_directory_file_list = [x for x in dirty_directory_file_list if x[0] != "." and x.endswith(".crypt") is False] # remove dotfiles and .crypt files + + # confirm that there are still files in the list after the dot files and encrypted files are removed + if len(clean_directory_file_list) == 0: + stderr("There are no unencrypted files in the directory.") + sys.exit(1) + + # create relative file paths for each file in the clean_directory_file_list + clean_directory_file_list_relpaths = [] + for clean_file in clean_directory_file_list: + new_file_path = make_path(path, clean_file) + clean_directory_file_list_relpaths.append(new_file_path) + + # prompt for the passphrase + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + from crypto.library.cryptor import Cryptor + the_cryptor = Cryptor(passphrase) + the_cryptor.encrypt_files(clean_directory_file_list_relpaths) # encrypt the list of directory files + the_cryptor.cleanup() + else: + # passphrases do not match + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + else: + # error message, not a file or directory. user entry error + stderr("The path that you entered does not appear to be an existing file or directory. Please try again.") + sys.exit(1) + + # ------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + # ------------------------------------------------------------------------------------------ + else: + print("Could not complete your request. Please try again.") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/decryptoapp.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/decryptoapp.py new file mode 100644 index 00000000..0528d3f6 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/decryptoapp.py @@ -0,0 +1,380 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# decrypto +# Copyright 2015 Christopher Simpkins +# MIT license +# ------------------------------------------------------------------------------ + +# Application start +def main(): + import os + import sys + from time import sleep + import getpass + import tarfile + from Naked.commandline import Command + from Naked.toolshed.shell import execute, muterun + from Naked.toolshed.system import dir_exists, file_exists, list_all_files, make_path, stdout, stderr, is_dir + from shellescape import quote + + # ------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + # ------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + # ------------------------------------------------------------------------------------------ + # [ VALIDATION LOGIC ] - early validation of appropriate command syntax + # Test that user entered at least one argument to the executable, print usage if not + # ------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(1) + # ------------------------------------------------------------------------------------------ + # [ HELP, VERSION, USAGE LOGIC ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/crypto/settings.py file + # ------------------------------------------------------------------------------------------ + if c.help(): # User requested crypto help information + from crypto.settings import help as crypto_help + print(crypto_help) + sys.exit(0) + elif c.usage(): # User requested crypto usage information + from crypto.settings import usage as crypto_usage + print(crypto_usage) + sys.exit(0) + elif c.version(): # User requested crypto version information + from crypto.settings import app_name, major_version, minor_version, patch_version + version_display_string = app_name + ' ' + major_version + '.' + minor_version + '.' + patch_version + print(version_display_string) + sys.exit(0) + # ------------------------------------------------------------------------------------------ + # [ APPLICATION LOGIC ] + # + # ------------------------------------------------------------------------------------------ + elif c.argc > 1: + # code for multi-file processing and commands that include options + use_standard_output = False # print to stdout flag + use_file_overwrite = False # overwrite existing file + untar_archives = True # untar decrypted tar archives, true by default + + # set user option flags + if c.option('--stdout') or c.option('-s'): + use_standard_output = True + if c.option('--overwrite') or c.option('-o'): + use_file_overwrite = True + if c.option('--nountar'): + untar_archives = False + + directory_list = [] # directory paths included in the user entered paths from the command line + file_list = [] # file paths included in the user entered paths from the command line (and inside directories entered) + + for argument in c.argv: + if file_exists(argument): # user included a file, add it to the file_list for decryption + if argument.endswith('.crypt'): + file_list.append(argument) # add .crypt files to the list of files for decryption + elif argument.endswith('.gpg'): + file_list.append(argument) + elif argument.endswith('.asc'): + file_list.append(argument) + elif argument.endswith('.pgp'): + file_list.append(argument) + else: + # cannot identify as an encrypted file, give it a shot anyways but warn user + file_list.append(argument) + stdout("Could not confirm that '" + argument + "' is encrypted based upon the file type. Attempting decryption. Keep your fingers crossed...") + elif dir_exists(argument): # user included a directory, add it to the directory_list + directory_list.append(argument) + else: + if argument[0] == "-": + pass # if it is an option, do nothing + else: + stderr("'" + argument + "' does not appear to be an existing file or directory. Aborting decryption attempt for this request.") + + # unroll the contained directory files into the file_list IF they are encrypted file types + if len(directory_list) > 0: + for directory in directory_list: + directory_file_list = list_all_files(directory) + for contained_file in directory_file_list: + if contained_file.endswith('.crypt'): + file_list.append(make_path(directory, contained_file)) # include the file with a filepath 'directory path/contained_file path' + elif contained_file.endswith('.gpg'): + file_list.append(make_path(directory, contained_file)) + elif contained_file.endswith('asc'): + file_list.append(make_path(directory, contained_file)) + elif contained_file.endswith('.pgp'): + file_list.append(make_path(directory, contained_file)) + + # confirm that there are files for decryption, if not abort + if len(file_list) == 0: + stderr("Could not identify files for decryption") + sys.exit(1) + + # get passphrase used to symmetrically decrypt the file + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + # begin decryption of each requested file. the directory path was already added to the file path above + for encrypted_file in file_list: + # create the decrypted file name + decrypted_filename = "" + if encrypted_file.endswith('.crypt'): + decrypted_filename = encrypted_file[0:-6] + elif encrypted_file.endswith('.gpg') or encrypted_file.endswith('.asc') or encrypted_file.endswith('.pgp'): + decrypted_filename = encrypted_file[0:-4] + else: + decrypted_filename = encrypted_file + '.decrypt' # if it was a file without a known encrypted file type, add the .decrypt suffix + + # determine whether file overwrite will take place with the decrypted file + skip_file = False # flag that indicates this file should not be encrypted + created_tmp_files = False + if not use_standard_output: # if not writing a file, no need to check for overwrite + if file_exists(decrypted_filename): + if use_file_overwrite: # rename the existing file to temp file which will be erased or replaced (on decryption failures) below + tmp_filename = decrypted_filename + '.tmp' + os.rename(decrypted_filename, tmp_filename) + created_tmp_files = True + else: + stdout("The file path '" + decrypted_filename + "' already exists. This file was not decrypted.") + skip_file = True + + # begin decryption + if not skip_file: + if use_standard_output: # using --quiet flag to suppress stdout messages from gpg, just want the file data in stdout stream + system_command = "gpg --batch --quiet --passphrase " + quote(passphrase) + " -d " + quote(encrypted_file) + successful_execution = execute(system_command) # use naked execute function to directly push to stdout, rather than return stdout + + if not successful_execution: + stderr("Unable to decrypt file '" + encrypted_file + "'", 0) + if created_tmp_files: # restore the moved tmp file to original if decrypt failed + tmp_filename = decrypted_filename + '.tmp' + if file_exists(tmp_filename): + os.rename(tmp_filename, decrypted_filename) + else: # decryption successful but we are in stdout flag so do not include any other output from decrypto + pass + else: + system_command = "gpg --batch -o " + quote(decrypted_filename) + " --passphrase " + quote(passphrase) + " -d " + quote(encrypted_file) + response = muterun(system_command) + + if response.exitcode == 0: + stdout("'" + encrypted_file + "' decrypted to '" + decrypted_filename + "'") + else: # failed decryption + if created_tmp_files: # restore the moved tmp file to original if decrypt failed + tmp_filename = decrypted_filename + '.tmp' + if file_exists(tmp_filename): + os.rename(tmp_filename, decrypted_filename) + # report the error + stderr(response.stderr) + stderr("Decryption failed for " + encrypted_file) + + # cleanup: remove the tmp file + if created_tmp_files: + tmp_filename = decrypted_filename + '.tmp' + if file_exists(tmp_filename): + os.remove(tmp_filename) + + # untar/extract any detected archive file(s) + if untar_archives is True: + if decrypted_filename.endswith('.tar') and tarfile.is_tarfile(decrypted_filename): + untar_path_tuple = os.path.split(decrypted_filename) + untar_path = untar_path_tuple[0] + if use_file_overwrite: + with tarfile.open(decrypted_filename) as tar: + if len(untar_path) > 0: + tar.extractall(path=untar_path) # use dir path from the decrypted_filename if not CWD + stdout("'" + decrypted_filename + "' unpacked in the directory path '" + untar_path + "'") + else: + tar.extractall() # else use CWD + stdout("'" + decrypted_filename + "' unpacked in the current working directory") + else: + with tarfile.TarFile(decrypted_filename, 'r', errorlevel=1) as tar: + for tarinfo in tar: + t_file = tarinfo.name + if len(untar_path) > 0: + t_file_path = os.path.join(untar_path, t_file) + else: + t_file_path = t_file + if not os.path.exists(t_file_path): + try: + if len(untar_path) > 0: + tar.extract(t_file, path=untar_path) # write to the appropriate dir + else: + tar.extract(t_file) # write to CWD + except IOError as e: + stderr( + "Failed to unpack the file '" + t_file_path + "' [" + str( + e) + "]") + elif is_dir(t_file_path): + pass # do nothing if it exists and is a directory, no need to warn + else: # it is a file and it already exists, provide user error message + stderr( + "Failed to unpack the file '" + t_file_path + "'. File already exists. Use the --overwrite flag to replace existing files.") + + # remove the decrypted tar archive file + os.remove(decrypted_filename) + + # overwrite the entered passphrases after file decryption is complete for all files + passphrase = "" + passphrase_confirm = "" + + # add a short pause to hinder brute force pexpect style password attacks with decrypto + sleep(0.2) # 200ms pause + + else: # passphrases did not match + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + + elif c.argc == 1: + # simple single file or directory processing with default settings + path = c.arg0 + if file_exists(path): # SINGLE FILE + check_existing_file = False # check for a file with the name of new decrypted filename in the directory + + if path.endswith('.crypt'): + decrypted_filename = path[0:-6] # remove the .crypt suffix + check_existing_file = True + elif path.endswith('.gpg') or path.endswith('.pgp') or path.endswith('.asc'): + decrypted_filename = path[0:-4] + check_existing_file = True + else: + decrypted_filename = path + ".decrypt" # if there is not a standard file type, then add a .decrypt suffix to the decrypted file name + stdout("Could not confirm that the requested file is encrypted based upon the file type. Attempting decryption. Keep your fingers crossed...") + + # confirm that the decrypted path does not already exist, if so abort with warning message to user + if check_existing_file is True: + if file_exists(decrypted_filename): + stderr("Your file will be decrypted to '" + decrypted_filename + "' and this file path already exists. Please move the file or use the --overwrite option with your command if you intend to replace the current file.") + sys.exit(1) + + # get passphrase used to symmetrically decrypt the file + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + # confirm that the passphrases match + if passphrase == passphrase_confirm: + system_command = "gpg --batch -o " + quote(decrypted_filename) + " --passphrase " + quote(passphrase) + " -d " + quote(path) + response = muterun(system_command) + + if response.exitcode == 0: + # unpack tar archive generated from the decryption, if present + if decrypted_filename.endswith('.tar') and tarfile.is_tarfile(decrypted_filename): + untar_path_tuple = os.path.split(decrypted_filename) + untar_path = untar_path_tuple[0] + + with tarfile.TarFile(decrypted_filename, 'r', errorlevel=1) as tar: + for tarinfo in tar: + t_file = tarinfo.name + if len(untar_path) > 0: + t_file_path = os.path.join(untar_path, t_file) + else: + t_file_path = t_file + if not os.path.exists(t_file_path): + try: + if len(untar_path) > 0: + tar.extract(t_file, path=untar_path) # write to the appropriate dir + else: + tar.extract(t_file) # write to CWD + except IOError as e: + stderr("Failed to unpack the file '" + t_file_path + "' [" + str(e) + "]") + elif is_dir(t_file_path): + pass # do nothing if it exists and is a directory, no need to warn + else: # it is a file and it already exists, provide user error message + stderr("Failed to unpack the file '" + t_file_path + "'. File already exists. Use the --overwrite flag to replace existing files.") + + # remove the decrypted tar archive + os.remove(decrypted_filename) + + stdout("Decryption complete") + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + sys.exit(0) + else: + stderr(response.stderr) + stderr("Decryption failed") + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + # add a short pause to hinder brute force pexpect style password attacks with decrypto + sleep(0.2) # 200ms pause + sys.exit(1) + else: + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + elif dir_exists(path): # SINGLE DIRECTORY + dirty_directory_file_list = list_all_files(path) + directory_file_list = [x for x in dirty_directory_file_list if (x.endswith('.crypt') or x.endswith('.gpg') or x.endswith('.pgp') or x.endswith('.asc'))] + + # if there are no encrypted files found, warn and abort + if len(directory_file_list) == 0: + stderr("There are no encrypted files in the directory") + sys.exit(1) + + # prompt for the passphrase + passphrase = getpass.getpass("Please enter your passphrase: ") + if len(passphrase) == 0: # confirm that user entered a passphrase + stderr("You did not enter a passphrase. Please repeat your command and try again.") + sys.exit(1) + passphrase_confirm = getpass.getpass("Please enter your passphrase again: ") + + if passphrase == passphrase_confirm: + # decrypt all of the encypted files in the directory + for filepath in directory_file_list: + absolute_filepath = make_path(path, filepath) # combine the directory path and file name into absolute path + + # remove file suffix from the decrypted file path that writes to disk + if absolute_filepath.endswith('.crypt'): + decrypted_filepath = absolute_filepath[0:-6] # remove the .crypt suffix + elif absolute_filepath.endswith('.gpg') or absolute_filepath.endswith('.pgp') or absolute_filepath.endswith('.asc'): + decrypted_filepath = absolute_filepath[0:-4] + + # confirm that the file does not already exist + if file_exists(decrypted_filepath): + stdout("The file path '" + decrypted_filepath + "' already exists. This file was not decrypted.") + else: + system_command = "gpg --batch -o " + quote(decrypted_filepath) + " --passphrase " + quote(passphrase) + " -d " + quote(absolute_filepath) + response = muterun(system_command) + + if response.exitcode == 0: + stdout("'" + absolute_filepath + "' decrypted to '" + decrypted_filepath + "'") + else: + stderr(response.stderr) + stderr("Decryption failed for " + absolute_filepath) + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + + # add a short pause to hinder brute force pexpect style password attacks with decrypto + sleep(0.2) # 200ms pause + else: + # overwrite user entered passphrases + passphrase = "" + passphrase_confirm = "" + stderr("The passphrases did not match. Please enter your command again.") + sys.exit(1) + else: + # error message, not a file or directory. user entry error + stderr("The path that you entered does not appear to be an existing file or directory. Please try again.") + sys.exit(1) + + # ------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + # ------------------------------------------------------------------------------------------ + else: + print("Could not complete your request. Please try again.") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/cryptor.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/cryptor.py new file mode 100644 index 00000000..49009bb4 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/cryptor.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +from Naked.toolshed.shell import muterun +from Naked.toolshed.system import file_size, stdout, stderr + +from shellescape import quote + +# ------------------------------------------------------------------------------ +# Cryptor class +# performs gpg encryption of one or more files +# ------------------------------------------------------------------------------ + + +class Cryptor(object): + """performs gpg encryption of one or more files""" + def __init__(self, passphrase): + self.command_default = "gpg -z 1 --batch --force-mdc --cipher-algo AES256 -o " + self.command_nocompress = "gpg -z 0 --batch --force-mdc --cipher-algo AES256 -o " + self.command_maxcompress = "gpg -z 7 --batch --force-mdc --cipher-algo AES256 -o " + self.command_default_armored = "gpg -z 1 --armor --batch --force-mdc --cipher-algo AES256 -o " + self.command_nocompress_armored = "gpg -z 0 --armor --batch --force-mdc --cipher-algo AES256 -o " + self.command_maxcompress_armored = "gpg -z 7 --armor --batch --force-mdc --cipher-algo AES256 -o " + self.passphrase = passphrase + self.common_binaries = set(['.7z', '.gz', '.aac', '.app', '.avi', '.azw', '.bz2', '.deb', '.doc', '.dmg', '.exe', '.flv', '.gif', '.jar', '.jpg', '.mov', '.mp3', '.mp4', '.odt', '.oga', '.ogg', '.ogm', '.pdf', '.pkg', '.png', '.ppt', '.pps', '.psd', '.rar', '.rpm', '.tar', '.tif', '.wav', '.wma', '.wmv', '.xls', '.zip', '.aiff', '.docx', '.epub', '.flac', '.mpeg', '.jpeg', '.pptx', '.xlsx']) + self.common_text = set(['.c', '.h', '.m', '.cc', '.js', '.pl', '.py', '.rb', '.sh', '.cpp', '.css', '.csv', '.php', '.rss', '.txt', '.xml', '.yml', '.java', '.json', '.html', '.yaml']) + + # ------------------------------------------------------------------------------ + # PUBLIC methods + # ------------------------------------------------------------------------------ + + # ------------------------------------------------------------------------------ + # encrypt_file : file encryption method + # ------------------------------------------------------------------------------ + def encrypt_file(self, inpath, force_nocompress=False, force_compress=False, armored=False, checksum=False): + """public method for single file encryption with optional compression, ASCII armored formatting, and file hash digest generation""" + if armored: + if force_compress: + command_stub = self.command_maxcompress_armored + elif force_nocompress: + command_stub = self.command_nocompress_armored + else: + if self._is_compress_filetype(inpath): + command_stub = self.command_default_armored + else: + command_stub = self.command_nocompress_armored + else: + if force_compress: + command_stub = self.command_maxcompress + elif force_nocompress: + command_stub = self.command_nocompress + else: + if self._is_compress_filetype(inpath): + command_stub = self.command_default + else: + command_stub = self.command_nocompress + + encrypted_outpath = self._create_outfilepath(inpath) + system_command = command_stub + encrypted_outpath + " --passphrase " + quote(self.passphrase) + " --symmetric " + quote(inpath) + + try: + response = muterun(system_command) + # check returned status code + if response.exitcode == 0: + stdout(encrypted_outpath + " was generated from " + inpath) + if checksum: # add a SHA256 hash digest of the encrypted file - requested by user --hash flag in command + from crypto.library import hash + encrypted_file_hash = hash.generate_hash(encrypted_outpath) + if len(encrypted_file_hash) == 64: + stdout("SHA256 hash digest for " + encrypted_outpath + " :") + stdout(encrypted_file_hash) + else: + stdout("Unable to generate a SHA256 hash digest for the file " + encrypted_outpath) + else: + stderr(response.stderr, 0) + stderr("Encryption failed") + sys.exit(1) + except Exception as e: + stderr("There was a problem with the execution of gpg. Encryption failed. Error: [" + str(e) + "]") + sys.exit(1) + + # ------------------------------------------------------------------------------ + # encrypt_files : multiple file encryption + # ------------------------------------------------------------------------------ + def encrypt_files(self, file_list, force_nocompress=False, force_compress=False, armored=False, checksum=False): + """public method for multiple file encryption with optional compression, ASCII armored formatting, and file hash digest generation""" + for the_file in file_list: + self.encrypt_file(the_file, force_nocompress, force_compress, armored, checksum) + + # ------------------------------------------------------------------------------ + # cleanup : overwrite the passphrase in memory + # ------------------------------------------------------------------------------ + def cleanup(self): + """public method that overwrites user passphrase in memory""" + self.passphrase = "" + + # ------------------------------------------------------------------------------ + # PRIVATE methods + # ------------------------------------------------------------------------------ + + def _create_outfilepath(self, inpath): + """private method that generates the crypto saved file path string with a .crypt file type""" + return inpath + '.crypt' + + def _is_compress_filetype(self, inpath): + """private method that performs magic number and size check on file to determine whether to compress the file""" + # check for common file type suffixes in order to avoid the need for file reads to check magic number for binary vs. text file + if self._is_common_binary(inpath): + return False + elif self._is_common_text(inpath): + return True + else: + # files > 10kB get checked for compression (arbitrary decision to skip compression on small files) + the_file_size = file_size(inpath) + if the_file_size > 10240: + if the_file_size > 512000: # seems to be a break point at ~ 500kb where file compression offset by additional file read, so limit tests to files > 500kB + try: + system_command = "file --mime-type -b " + quote(inpath) + response = muterun(system_command) + if response.stdout[0:5] == "text/": # check for a text file mime type + return True # appropriate size, appropriate file mime type + else: + return False # appropriate size, inappropriate file mime type + except Exception: + return False + else: + return True # if file size is < 500kB, skip the additional file read and just go with compression + else: + return False # below minimum size to consider compression, do not compress + + def _is_common_binary(self, inpath): + """private method to compare file path mime type to common binary file types""" + # make local variables for the available char numbers in the suffix types to be tested + two_suffix = inpath[-3:] + three_suffix = inpath[-4:] + four_suffix = inpath[-5:] + + # test for inclusion in the instance variable common_binaries (defined in __init__) + if two_suffix in self.common_binaries: + return True + elif three_suffix in self.common_binaries: + return True + elif four_suffix in self.common_binaries: + return True + else: + return False + + def _is_common_text(self, inpath): + """private method to compare file path mime type to common text file types""" + # make local variables for the available char numbers in the suffix types to be tested + one_suffix = inpath[-2:] + two_suffix = inpath[-3:] + three_suffix = inpath[-4:] + four_suffix = inpath[-5:] + + # test for inclusion in the instance variable common_text (defined in __init__) + if one_suffix in self.common_text: + return True + elif two_suffix in self.common_text: + return True + elif three_suffix in self.common_text: + return True + elif four_suffix in self.common_text: + return True + else: + return False diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/hash.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/hash.py new file mode 100644 index 00000000..8d66e37b --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/hash.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import hashlib +from Naked.toolshed.file import FileReader + +# ------------------------------------------------------------------------------ +# PUBLIC +# ------------------------------------------------------------------------------ +def generate_hash(filepath): + """Public function that reads a local file and generates a SHA256 hash digest for it""" + fr = FileReader(filepath) + data = fr.read_bin() + return _calculate_sha256(data) + + +# ------------------------------------------------------------------------------ +# PRIVATE +# ------------------------------------------------------------------------------ +def _calculate_sha256(binary_string): + """Private function that calculates a SHA256 hash digest for a binary string argument""" + return hashlib.sha256(binary_string).hexdigest() + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/package.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/package.py new file mode 100644 index 00000000..e4674ca2 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/library/package.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import tarfile +from Naked.toolshed.system import stderr, dir_exists, file_exists + +# ------------------------------------------------------------------------------ +# PUBLIC +# ------------------------------------------------------------------------------ + + +def generate_tar_files(directory_list): + """Public function that reads a list of local directories and generates tar archives from them""" + + tar_file_list = [] + + for directory in directory_list: + if dir_exists(directory): + _generate_tar(directory) # create the tar archive + tar_file_list.append(directory + '.tar') # append the tar archive filename to the returned tar_file_list list + else: + stderr("The directory '" + directory + "' does not exist and a tar archive could not be created from it.", exit=1) + + return tar_file_list + + +def remove_tar_files(file_list): + """Public function that removes temporary tar archive files in a local directory""" + for f in file_list: + if file_exists(f) and f.endswith('.tar'): + os.remove(f) # remove any tar files in the list, if it does not appear to be a tar file, leave it alone + +# ------------------------------------------------------------------------------ +# PRIVATE +# ------------------------------------------------------------------------------ + + +def _generate_tar(dir_path): + """Private function that reads a local directory and generates a tar archive from it""" + try: + with tarfile.open(dir_path + '.tar', 'w') as tar: + tar.add(dir_path) + except tarfile.TarError as e: + stderr("Error: tar archive creation failed [" + str(e) + "]", exit=1) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/settings.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/settings.py new file mode 100644 index 00000000..ebcebd1c --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Crypto/settings.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# Application Name +# ------------------------------------------------------------------------------ +app_name = 'crypto' + +# ------------------------------------------------------------------------------ +# Version Number +# ------------------------------------------------------------------------------ +major_version = "1" +minor_version = "4" +patch_version = "1" + +# ------------------------------------------------------------------------------ +# Debug Flag (switch to False for production release code) +# ------------------------------------------------------------------------------ +debug = False + +# ------------------------------------------------------------------------------ +# Usage String +# ------------------------------------------------------------------------------ +usage = """ +Encrypt by explicit file path: +------------------------------ + crypto [file path] + + +Encrypt all top level files in directory: +----------------------------------------- + crypto [directory path] + + +Create a tar archive from directory and encrypt the archive: +----------------------------------------------------------- + crypto --tar [directory path] + + +Decrypt by explicit file path: +------------------------------ + decrypto [file path] + + +Decrypt all top level encrypted files in directory: +--------------------------------------------------- + decrypto [directory path] + + +Enter `crypto --help` or `decrypto --help` to view the available options. + +""" + +# ------------------------------------------------------------------------------ +# Help String +# ------------------------------------------------------------------------------ +help = """ +------------------------------------------------- +crypto +Simple symmetric GPG file encryption +Copyright 2015 Christopher Simpkins +MIT license +Source: https://github.com/chrissimpkins/crypto +Docs: https://chrissimpkins.github.io/crypto/ +------------------------------------------------- + +ABOUT +crypto provides a simple interface to symmetric Gnu Privacy Guard (gpg) encryption and decryption for one or more files. gpg must be installed on your system in order to use the crypto and decrypto executables. + +USAGE + ENCRYPTION + crypto [file path] + crypto [directory path] + + DECRYPTION + decrypto [file path] + decrypto [directory path] + +CRYPTO OPTIONS + --armor | -a Use a portable ASCII armored encryption format + --hash Generate SHA256 hash digest of encrypted file(s) + --space Favor reduced file size over encryption speed + --speed Favor encryption speed over reduced file size + --tar Create tar archive of directory of files before encryption + +DECRYPTO OPTIONS + --nountar Do not automatically unpack decrypted tar archives + --overwrite | -o Overwrite an existing file with the decrypted file + --stdout | -s Print file contents to the standard output stream + +OTHER OPTIONS + --help | -h Display crypto and decrypto help + --usage Display crypto and decrypto usage + --version | -v Display version number + +DESCRIPTION +Use one or more explicit file path arguments to encrypt or decrypt the file(s). crypto and decrypto will attempt to encrypt or decrypt (respectively) any explicit filepaths that you include irrespective of the file type. Encrypted files are generated on the path '.crypt'. The original file is not modified or removed by crypto. + +Use one or more directory arguments with the crypto executable to encrypt all files in the top level of each directory with the same passphrase. Previously encrypted files with a '.crypt' file type will not be generated again in a directory. Remove them before you run the command if you intend to repeat encryption with a file. + +Use one or more directory arguments with decrypto to decrypt all .crypt, .gpg, .asc, and .pgp files in the top level of each directory. decrypto automatically unpacks decrypted tar archives. + +Encryption is performed with the AES256 cipher algorithm. Decryption will take place with any cipher algorithm that your version of gpg supports. +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst new file mode 100644 index 00000000..ff207c1d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/DESCRIPTION.rst @@ -0,0 +1,36 @@ +About +------ + +`Naked `_ is a new Python command line application framework that is in development. The current release is a stable, testing release. + +Updates +-------- + +Changes, updates, and brief tutorials are available on the `developer log `_. + +QuickStart Guide +------------------ + +The quickstart guide is available at `http://docs.naked-py.com/quickstart.html `_. It demonstrates how the available tools can be incorporated into your development workflow, spanning the entire period from an empty project directory to your first PyPI version release. + +Documentation +-------------- + +Documentation is in development at `http://docs.naked-py.com/ `_ + +Issue Reporting +---------------- + +Issue reporting is available on the `GitHub repository `_ + +Contribute +----------- + +I would greatly appreciate feedback from anyone who is testing the framework. Feel free to contact me on Twitter (@csimpkins) if you have questions, comments, or problems. Please use the issue reporting link above for bug reports. + +Example Application +------------------- + +`Status `_ was built from the ground up with the Naked Framework. If you'd like to check out the source, it is available on `GitHub `_ + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/INSTALLER b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/METADATA b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/METADATA new file mode 100644 index 00000000..0662854c --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/METADATA @@ -0,0 +1,61 @@ +Metadata-Version: 2.0 +Name: Naked +Version: 0.1.31 +Summary: A command line application framework +Home-page: http://naked-py.com +Author: Christopher Simpkins +Author-email: chris@zerolabs.net +License: MIT +Keywords: python,command line,system,application,framework,CLI +Platform: any +Classifier: Intended Audience :: Developers +Classifier: Natural Language :: English +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Dist: Naked +Requires-Dist: requests +Requires-Dist: pyyaml + +About +------ + +`Naked `_ is a new Python command line application framework that is in development. The current release is a stable, testing release. + +Updates +-------- + +Changes, updates, and brief tutorials are available on the `developer log `_. + +QuickStart Guide +------------------ + +The quickstart guide is available at `http://docs.naked-py.com/quickstart.html `_. It demonstrates how the available tools can be incorporated into your development workflow, spanning the entire period from an empty project directory to your first PyPI version release. + +Documentation +-------------- + +Documentation is in development at `http://docs.naked-py.com/ `_ + +Issue Reporting +---------------- + +Issue reporting is available on the `GitHub repository `_ + +Contribute +----------- + +I would greatly appreciate feedback from anyone who is testing the framework. Feel free to contact me on Twitter (@csimpkins) if you have questions, comments, or problems. Please use the issue reporting link above for bug reports. + +Example Application +------------------- + +`Status `_ was built from the ground up with the Naked Framework. If you'd like to check out the source, it is available on `GitHub `_ + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/RECORD new file mode 100644 index 00000000..00b76a6f --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/RECORD @@ -0,0 +1,118 @@ +../../Scripts/naked.exe,sha256=35rPGPQpM8Q9AmUGglTbVq8Xu-eeU0QwCv_D8OWemHw,102727 +Naked-0.1.31.data/scripts/naked,sha256=Ps1mufxMkBG7wwaJHQ_nkMwOrPP1hTZLDH7YMNO4Y2E,285 +Naked-0.1.31.dist-info/DESCRIPTION.rst,sha256=26S5QwAzVdLRvvgm9ZsFe2VsF2f6xybGklQEMt0T05s,1450 +Naked-0.1.31.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Naked-0.1.31.dist-info/METADATA,sha256=z7IWAlMC3eIlNc8RlWxJ1feuDhdlQtziBOXXzcZK-c8,2341 +Naked-0.1.31.dist-info/RECORD,, +Naked-0.1.31.dist-info/WHEEL,sha256=SXYYsi-y-rEGIva8sB8iKF6bAFD6YDhmqHX5hI3fc0o,110 +Naked-0.1.31.dist-info/entry_points.txt,sha256=-7nL8pc5fnKhIUINYqLDa1jd3y-8jynn9u5qF9EyjqU,42 +Naked-0.1.31.dist-info/pydist.json,sha256=cSetsKYPMVxYIilVGZD_wtke5QtnHkWmKGTF5uDSV10,1119 +Naked-0.1.31.dist-info/top_level.txt,sha256=CG1yk0vViILO5nUzrfUqtOs-0IAsZBY1zLFGi3O-SCc,6 +Naked/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/__pycache__/__init__.cpython-37.pyc,, +Naked/__pycache__/app.cpython-37.pyc,, +Naked/__pycache__/commandline.cpython-37.pyc,, +Naked/__pycache__/scratchpad.cpython-37.pyc,, +Naked/__pycache__/settings.cpython-37.pyc,, +Naked/app.py,sha256=ifeYxmcVb3aolzqZNzeQGF6rnTuJatyM3swhf68G5cc,11880 +Naked/commandline.py,sha256=OJ-ktVQWZeKMTbC1r446M0m1BZidwBQMA5hpXrTMK5U,18918 +Naked/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/commands/__pycache__/__init__.cpython-37.pyc,, +Naked/commands/__pycache__/args.cpython-37.pyc,, +Naked/commands/__pycache__/build.cpython-37.pyc,, +Naked/commands/__pycache__/classifier.cpython-37.pyc,, +Naked/commands/__pycache__/dist.cpython-37.pyc,, +Naked/commands/__pycache__/help.cpython-37.pyc,, +Naked/commands/__pycache__/locate.cpython-37.pyc,, +Naked/commands/__pycache__/make.cpython-37.pyc,, +Naked/commands/__pycache__/profile.cpython-37.pyc,, +Naked/commands/__pycache__/pyh.cpython-37.pyc,, +Naked/commands/__pycache__/test.cpython-37.pyc,, +Naked/commands/__pycache__/usage.cpython-37.pyc,, +Naked/commands/__pycache__/version.cpython-37.pyc,, +Naked/commands/args.py,sha256=DhW7JF2FNU0ns3P0RrcKM_aN8Pn51zfgLpa7edS7QoE,4681 +Naked/commands/build.py,sha256=SDs5d6s4aCyT6zKWpJ4CgYnu8VKx910CKRe-E9mFhS8,1040 +Naked/commands/classifier.py,sha256=NY4eOKDh3xiSJbJfvxN8D-YqjJrqc8qQ9e03vlPAf-A,1875 +Naked/commands/dist.py,sha256=qGG1l9Z1T882WvRjBKIs-UQWSbN9efaZkK-qSYTTVV4,3287 +Naked/commands/help.py,sha256=cQzrW2Axb4X_zR4JElmCaWUcE1xk2Sf9VpNO31FAimA,300 +Naked/commands/locate.py,sha256=9wZ_RSCNju1hWGkrUGDOSlWTPg6cbA4_cKJuAKW4sxs,1449 +Naked/commands/make.py,sha256=ikbMj3T24LExBaxgd465DBNNemqZb8y6RHHnKJTsQFY,18788 +Naked/commands/profile.py,sha256=Rz_rWwdqXy6WrWrPaDCBrsVBwpJrwRCrsnHtqj-LmZ0,1700 +Naked/commands/pyh.py,sha256=Bqfo513IKwPB0xY4YvtUSdvpSIetE9tW-gfTG2VoMqY,1071 +Naked/commands/test.py,sha256=-T_cXmbS5BoL7wKuC6VxQ0W8-Q-dcRl64fVZsiEj75g,6720 +Naked/commands/usage.py,sha256=ASp5GkdPHEd9Nz_rYNfjojI0KXmHMhmbs7ktte6LecY,305 +Naked/commands/version.py,sha256=kSPrr4blhbTST1SNUEKnnD9UrP9UW7s9ehos-qiM5as,789 +Naked/scratchpad.py,sha256=NJ6NYQrmzVHDHOEagFcACuSp0C2FiyKhHwpZbz7VkXE,743 +Naked/settings.py,sha256=uXuD_QpSbaOL37N-p_4pk1Fsrb_uQpIl3wkg6uTR8Cw,2976 +Naked/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/templates/__pycache__/__init__.cpython-37.pyc,, +Naked/templates/__pycache__/app_file.cpython-37.pyc,, +Naked/templates/__pycache__/licenses.cpython-37.pyc,, +Naked/templates/__pycache__/manifest_in_file.cpython-37.pyc,, +Naked/templates/__pycache__/profiler_file.cpython-37.pyc,, +Naked/templates/__pycache__/pypush_file.cpython-37.pyc,, +Naked/templates/__pycache__/readme_md_file.cpython-37.pyc,, +Naked/templates/__pycache__/settings_file.cpython-37.pyc,, +Naked/templates/__pycache__/setup_cfg_file.cpython-37.pyc,, +Naked/templates/__pycache__/setup_py_file.cpython-37.pyc,, +Naked/templates/app_file.py,sha256=A874Fi7TBfX2O8uMEcYvNbpUvc15C-rrFbT9MLWOL0Q,5188 +Naked/templates/licenses.py,sha256=WF2mFsv8oH_xUdEJMY17oWxmjmShOagYBQRdGReIxxE,6052 +Naked/templates/manifest_in_file.py,sha256=9FkG7ZHdadisE-Uh7qdI69Hn-hfACTo7II8LG23bGBY,109 +Naked/templates/profiler_file.py,sha256=XSxC4nBng26j7NmmmOXHz2wZ4702FpAGntaNeQ8WGLw,1530 +Naked/templates/pypush_file.py,sha256=RUndgzH4y9LhYgka1oTvVB__yfvXdysNdK7qOzwONyE,586 +Naked/templates/readme_md_file.py,sha256=njESHWuw5heC2EjRe8m7BgY1Wv2gXMUSnf0SjXLLpB4,104 +Naked/templates/settings_file.py,sha256=bkCfQE_qp-tdXCwBdII_4IqaO2U5XJUyh-QvTypOW1s,1179 +Naked/templates/setup_cfg_file.py,sha256=Bl-AkoQWe2Ath13L68J6pnzVPyz0FRmr7vCKIdyeAkU,107 +Naked/templates/setup_py_file.py,sha256=Z2c0FpDTKnRP2txJB7fSCEkD17CnyTgIFOLCRlR_kgs,1769 +Naked/toolshed/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/toolshed/__pycache__/__init__.cpython-37.pyc,, +Naked/toolshed/__pycache__/benchmarking.cpython-37.pyc,, +Naked/toolshed/__pycache__/casts.cpython-37.pyc,, +Naked/toolshed/__pycache__/file.cpython-37.pyc,, +Naked/toolshed/__pycache__/git.cpython-37.pyc,, +Naked/toolshed/__pycache__/ink.cpython-37.pyc,, +Naked/toolshed/__pycache__/iter.cpython-37.pyc,, +Naked/toolshed/__pycache__/network.cpython-37.pyc,, +Naked/toolshed/__pycache__/python.cpython-37.pyc,, +Naked/toolshed/__pycache__/shell.cpython-37.pyc,, +Naked/toolshed/__pycache__/state.cpython-37.pyc,, +Naked/toolshed/__pycache__/system.cpython-37.pyc,, +Naked/toolshed/__pycache__/types.cpython-37.pyc,, +Naked/toolshed/benchmarking.py,sha256=Dn5EXmR_wiAtG-mqWmBFQJ_i749_-hZ1-PxEBwSsAwQ,17235 +Naked/toolshed/c/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Naked/toolshed/c/__pycache__/__init__.cpython-37.pyc,, +Naked/toolshed/c/__pycache__/setup.cpython-37.pyc,, +Naked/toolshed/c/benchmarking.c,sha256=UDYMyo3eaMQB0cc28AfkyePULEQuvtqaFeZWK9DgzLM,880286 +Naked/toolshed/c/benchmarking.pyx,sha256=Dn5EXmR_wiAtG-mqWmBFQJ_i749_-hZ1-PxEBwSsAwQ,17235 +Naked/toolshed/c/build.sh,sha256=LEtZwrw9A6Tx4Z-tSf4kjSKFLTyX97xs5uoJBcitB8w,36 +Naked/toolshed/c/casts.c,sha256=bgEj7BmtKcHmMd1W5qIcOC8_KH5BP66z3x_tLMF4N7I,227012 +Naked/toolshed/c/casts.pyx,sha256=Jq6Wt3re7fS1-ry9uD4B38yfGi-CbwhxsLZl8HODNis,4813 +Naked/toolshed/c/cstate.c,sha256=qTe_e46gCtGYUdgt--ulHl9NaE4T_K7j7D5V93AUawA,134375 +Naked/toolshed/c/cstate.pyx,sha256=5EDxBjneKCRyEwQslZspCLl1A2i7dMtEIu1mfM75qpo,1089 +Naked/toolshed/c/cythonize.sh,sha256=-Fy5q0oMAqOKj5aFDfRuaQUPpqGrKCSDatPdFt0d_zI,256 +Naked/toolshed/c/file.c,sha256=DtLXGU5JzSJCDzC8tZxM0k_ucf3ONwepxB6Q1fipL1I,623270 +Naked/toolshed/c/file.pyx,sha256=ru3r-7QVgTubZ3sbbNO_jqF0o_qfJBYzfGSXPL7X18c,19965 +Naked/toolshed/c/ink.c,sha256=L0brN1oD-airTLFV378wfkLZ6r1MgAHozsl5GlaMjdo,185313 +Naked/toolshed/c/ink.pyx,sha256=r73b8N46boGa7Cerw88uPGk3luNQWgoE7SS2Ru4k0ys,5460 +Naked/toolshed/c/network.c,sha256=ft-bqnr3ervphD1IXiXN9krqZ6GJPmLA2OdrH9N8CaE,525661 +Naked/toolshed/c/network.pyx,sha256=-NX-7RFbN2DAsOdW4mvtNYnCP1GVHx8CQubmL7wjaQg,19549 +Naked/toolshed/c/python.c,sha256=E2rAQDq1pVgehMwDQenNF5ZZIBdpauHKA5TKFPWxBSk,111860 +Naked/toolshed/c/python.pyx,sha256=WTST5lYVqizCtAXbHZqd5HGOO9ywCCxP8dbzLB2tbcM,2157 +Naked/toolshed/c/setup.py,sha256=oOuer8J1ZqJxxWhXiYzmtPmyeaQy2FNQNp1c99AzF4U,654 +Naked/toolshed/c/shell.c,sha256=1CrgdwUQsHkkzKKvVYfmZoA6OaG23xqriKiO0a_secI,376470 +Naked/toolshed/c/shell.pyx,sha256=efpvnnT8cu6xXOGvhqd2MpMCiv2Z4Eau8VjRp9pAYSc,12629 +Naked/toolshed/c/system.c,sha256=bSRfuYZe8C5nIk2WZrcXm5eYeJZ-3OwD5gzx2jwUPtE,620280 +Naked/toolshed/c/system.pyx,sha256=bPjCcxkWLuS-X5CZgUC8Rkilc2x-S-X2e9MkvzEf-xw,24684 +Naked/toolshed/c/types.c,sha256=STvR0OE_PLkGros1B0vjepCZdhClEjjaCEkqyuZNMOc,1240797 +Naked/toolshed/c/types.pyx,sha256=ep0NkR_OFbmp96KaAx5mxPYYUTtc7V6L1qSkaLS_oq8,44721 +Naked/toolshed/casts.py,sha256=elaNlp0hBRJ_bFPTX-4eYB90gmPrbVPz_6TY4HFrbc8,5126 +Naked/toolshed/file.py,sha256=FnYhoVCgnTYU-WjedCLJFgsd9UkvbvJNt5J-ftWML3E,19941 +Naked/toolshed/git.py,sha256=WAX_snuOFpVIIBPRsIZXva24wK67MEBNZE5eST4fSDg,79 +Naked/toolshed/ink.py,sha256=9i_ZJpgpXtLqDs32OFGoeiNU7Ajo7xwKmI9FdCCcMt8,5436 +Naked/toolshed/iter.py,sha256=yUalH_tyXYtEqsFDuy2n5ZfussXmdFunzgA4W7Ydz9M,500 +Naked/toolshed/network.py,sha256=VpTSm6XQy2Pm_-atsqyt5vd9ZMnYFrJsfJhPwZ2R-js,19525 +Naked/toolshed/python.py,sha256=lY-Nb8nymApIyI4pWJNHst11VA8IJygBF62ASnjg9Yk,2158 +Naked/toolshed/shell.py,sha256=8hAdzS15TTzofHr2mRCLpf7ThTNiDVouQjWI18LSCNg,12605 +Naked/toolshed/state.py,sha256=_PnDMY5Vws9JXN6VdoQlNWwhZ1EwoiwUDu-qjl_Nmk4,1061 +Naked/toolshed/system.py,sha256=IeJhooglhxKbKiG5NYw6_ye8MeRKNSY5nOz1BZCZBNk,24660 +Naked/toolshed/types.py,sha256=xd_Bu_fKu0FbULD4EvwQ_OBYWMuBVj5r4pEx4Wm7riA,44532 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL new file mode 100644 index 00000000..f2ddc351 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.22.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt new file mode 100644 index 00000000..e69cfe8f --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +naked = Naked.app:main + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json new file mode 100644 index 00000000..9defc826 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/pydist.json @@ -0,0 +1 @@ +{"license": "MIT", "exports": {"console_scripts": {"naked": "Naked.app:main"}}, "document_names": {"description": "DESCRIPTION.rst"}, "name": "Naked", "metadata_version": "2.0", "contacts": [{"role": "author", "email": "chris@zerolabs.net", "name": "Christopher Simpkins"}], "generator": "bdist_wheel (0.22.0)", "commands": {"wrap_console": {"naked": "Naked.app:main"}}, "summary": "A command line application framework", "project_urls": {"Home": "http://naked-py.com"}, "platform": "any", "run_requires": [{"requires": ["Naked", "requests", "pyyaml"]}], "version": "0.1.31", "keywords": "python,command line,system,application,framework,CLI", "classifiers": ["Intended Audience :: Developers", "Natural Language :: English", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules"], "extras": []} \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt new file mode 100644 index 00000000..007f0295 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked-0.1.31.dist-info/top_level.txt @@ -0,0 +1 @@ +Naked diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/app.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/app.py new file mode 100644 index 00000000..0b5218f0 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/app.py @@ -0,0 +1,229 @@ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# Naked | A Python command line application framework +# Copyright 2014 Christopher Simpkins +# MIT License +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------ +# c.cmd = Primary command ( ) +# c.cmd2 = Secondary command ( ) +# +# c.option(option_string, [bool argument_required]) = test for option with optional test for positional arg to the option +# c.option_with_arg(option_string) = test for option and mandatory positional argument to option test +# c.flag(flag_string) = test for presence of a "--option=argument" style flag +# +# c.arg(arg_string) = returns the next positional argument to the arg_string argument +# c.flag_arg(flag_string) = returns the flag assignment for a "--option=argument" style flag +#------------------------------------------------------------------------------------ + +# Application start +def main(): + import sys + from Naked.commandline import Command + #from Naked.toolshed.state import StateObject + from Naked.toolshed.system import stderr + + #------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + #------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + #------------------------------------------------------------------------------ + # [ Instantiate state object ] + #------------------------------------------------------------------------------ + #state = StateObject() + #------------------------------------------------------------------------------------------ + # [ Command Suite Validation ] - early validation of appropriate command syntax + # Test that user entered a primary command, print usage if not + #------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from Naked.commands.usage import Usage + Usage().print_usage() + sys.exit(1) + #------------------------------------------------------------------------------------------ + # [ PRIMARY COMMAND LOGIC ] + # Test for primary commands and handle them + #------------------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ args ] - identify the parsed arguments for a command string (2)= help + #------------------------------------------------------------------------------ + if c.cmd == "args": + if c.cmd2 == "help": + from Naked.commands.args import help as args_help + args_help() + elif c.argc > 0: # there is an argument to where that is not help + from Naked.commands.args import Args + a = Args(c.arg_to_cmd) + a.run() + else: + stderr("The args command requires an example command as an argument. Use 'naked args help' for more information.", 1) + #------------------------------------------------------------------------------ + # [ build ] - build the C code in the Naked library (2)= help + #------------------------------------------------------------------------------ + elif c.cmd == "build": + if c.cmd2 == "help": + from Naked.commands.build import help as build_help + build_help() + else: + from Naked.commands.build import compile_c_code + import os, inspect + abs_dirpath = os.path.join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))), "toolshed", "c") + compile_c_code(abs_dirpath) # function calls exit status code + #------------------------------------------------------------------------------ + # [ classify ] - search Python application classifiers and display to user (args)-search string + #------------------------------------------------------------------------------ + elif c.cmd == "classify": + if c.cmd2 == "help": + from Naked.commands.classifier import help as classifier_help + classifier_help() + else: + if c.second: # if search string was given + search_string = c.second + else: + search_string = "" # absence of search string detected in Classifier, defaults to the entire list instead of search + from Naked.commands.classifier import Classifier + c = Classifier(search_string) + c.run() + #------------------------------------------------------------------------------ + # [ dist ] - distribute source files to PyPI (2)=register, sdist, swheel, wheel, win, all, help + #------------------------------------------------------------------------------ + elif c.cmd == "dist": + if c.argc > 1: + from Naked.commands.dist import Dist + d = Dist() + if c.cmd2 == "register": # python setup.py register + d.run('register') + elif c.cmd2 == "sdist": # python setup.py sdist upload + d.run('sdist') + elif c.cmd2 == "swheel": # python setup.py sdist bdist_wheel upload + d.run('swheel') + elif c.cmd2 == "wheel": # python setup.py bdist_wheel upload + d.run('wheel') + elif c.cmd2 == "win": # python setup.py bdist_wininst upload + d.run('win') + elif c.cmd2 == "all": # python setup.py sdist bdist_wheel bdist_wininst upload + d.run('all') + elif c.cmd2 == "help": # help for command + from Naked.commands.dist import help as dist_help + dist_help() + else: + stderr("The naked dist secondary command was not recognized. Use 'naked dist help' for more information.", 1) + else: + stderr("Please enter a secondary command", 1) + #------------------------------------------------------------------------------ + # [ locate ] - locate Naked project files (2)= main, settings, setup, help + #------------------------------------------------------------------------------ + elif c.cmd == "locate": + from Naked.commands.locate import Locator + if c.cmd2 == "help": + from Naked.commands.locate import help as locate_help + locate_help() + elif c.cmd2 == "main": + l = Locator('main') + elif c.cmd2 == "settings": + l = Locator('settings') + elif c.cmd2 == "setup": + l = Locator('setup') + else: + l = Locator('') #handles error report to user + #------------------------------------------------------------------------------ + # [ make ] - make a new Naked project (2)=help (args)=project name + #------------------------------------------------------------------------------ + elif c.cmd == "make": + from Naked.commands.make import MakeController + if c.cmd2 == "help": + from Naked.commands.make import help as make_help + make_help() + if c.arg1: # arg1 is not help so use it as the argument to the make command + m = MakeController(c.arg1) + else: + m = MakeController(None) + m.run() + #------------------------------------------------------------------------------ + # [ profile ] - run the profiler.py file in the Naked project (2)=help + #------------------------------------------------------------------------------ + elif c.cmd == "profile": + if c.cmd2 == "help": + from Naked.commands.profile import help as profile_help + profile_help() + else: + from Naked.commands.profile import Profiler + p = Profiler() + p.run() + + #------------------------------------------------------------------------------ + # [ pyh ] - help for python built-in library modules, classes, methods, functions + #------------------------------------------------------------------------------ + elif c.cmd == "pyh": + if c.cmd2 == "help": + from Naked.commands.pyh import pyh_help + pyh_help() + else: + if c.argc > 1: + from Naked.commands.pyh import python_help + python_help(c.arg1) + else: + stderr("Please enter a query term with the pyh command. Use 'naked pyh help' for more information.", 1) + + #------------------------------------------------------------------------------ + # [ test ] - Run unit tests on the project (2)= help,nose,pytest,tox,unittest (see help for args) + #------------------------------------------------------------------------------ + elif c.cmd == "test": + if c.argc > 1: + if c.cmd2 == "help": + from Naked.commands.test import help as tox_help + tox_help() + elif c.cmd2 == "nose": + from Naked.commands.test import NoseTester + n = NoseTester() + n.run() + elif c.cmd2 == "pytest": + from Naked.commands.test import PyTester + p = PyTester() + p.run() + elif c.cmd2 == "tox": + from Naked.commands.test import ToxTester + if c.arg2: #user specified a python version to run with one of the tox version defs + t = ToxTester(c.arg2) #instantiate with the python version + else: + t = ToxTester() + t.run() + elif c.cmd2 == "unittest": + from Naked.commands.test import UnitTester + if c.arg2: + t = UnitTester(c.arg2) + t.run() + else: + stderr("Please include a unit test file path. Use 'naked test help' for more information.", 1) + else: + stderr("The secondary command was not recognized. Use 'naked test help' for more information.", 1) + else: + stderr("Please include a secondary command with the 'naked test' command. Use 'naked dist help' for more information.", 1) + + #------------------------------------------------------------------------------------------ + # [ NAKED FRAMEWORK COMMANDS ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/PROJECT/settings.py file + #------------------------------------------------------------------------------------------ + elif c.help(): # User requested naked help (help.py module in commands directory) + from Naked.commands.help import Help + Help().print_help() + elif c.usage(): # user requested naked usage info (usage.py module in commands directory) + from Naked.commands.usage import Usage + Usage().print_usage() + elif c.version(): # user requested naked version (version.py module in commands directory) + from Naked.commands.version import Version + Version().print_version() + #------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + #------------------------------------------------------------------------------------------ + else: + print("Could not complete the command that you entered. Please try again.") + sys.exit(1) #exit + +if __name__ == '__main__': + main() diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commandline.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commandline.py new file mode 100644 index 00000000..b51951f8 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commandline.py @@ -0,0 +1,371 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +from Naked.settings import debug as DEBUG_FLAG +##################################################################### +# [ Command class ] +# Command line command string object +# argv = list of command line arguments and options +# argc = count of command line arguments and options +# arg0 = first positional argument to command +# arg1 = second positional argument to command +# arglp = last positional argument to command +# cmd = primary command for command suite application (=arg0) +# cmd2 = secondary command for command suite application (=arg1) +# snippet for py block comment = #py + TAB +##################################################################### +class Command: + def __init__(self, app_path, argv): + self.argobj = Argument(argv) # create an Argument obj + self.optobj = Option(argv) # create an Option obj + self.app = app_path # path to application executable file + self.argv = argv # list of the command arguments argv[0] is first argument + self.argc = len(argv) # length of the argument list + self.arg0 = self.argobj._getArg(0) # define the first positional argument + self.arg1 = self.argobj._getArg(1) # define the second positional argument + self.arg2 = self.argobj._getArg(2) # define the third postitional argument + self.arg3 = self.argobj._getArg(3) # define the fourth positional argument + self.arg4 = self.argobj._getArg(4) # define the fifth positional argument + self.arglp = self.argobj._getArg(len(argv) - 1) # define the last positional argument + self.first = self.arg0 + self.second = self.arg1 + self.third = self.arg2 + self.fourth = self.arg3 + self.fifth = self.arg4 + self.last = self.arglp + self.arg_to_exec = self.arg0 # argument to the executable + self.arg_to_cmd = self.arg1 # argument to the primary command + self.cmd = self.arg0 # define the primary command variable as the first positional argument (user dependent & optional, may be something else) + self.cmd2 = self.arg1 # define the secondary command variable as the second positional argument (user dependent & optional, may be something else) + self.options = self.option_exists() # test for presence of at least one option (boolean) + self.flags = self.flag_exists() # test for presence of at least one flag (boolean) + + #------------------------------------------------------------------------------ + # [ app_validates_args method ] (boolean) + # Test whether app validates on the criterion arguments (argc) > 0, i.e. there is at least one argument to the executable + #------------------------------------------------------------------------------ + def app_validates_args(self): + try: + if self.argc > 0: + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Validation of application error in the app_validates() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ arg method ] (string) + # Return the NEXT positional argument to a command line object (e.g. an option that requires an argument) + # arg_recipient = the positional argument (at position n) to test for next positional argument + # returns next positional argument string at position n + 1 + #------------------------------------------------------------------------------------------ + def arg(self, arg_recipient): + try: + recipient_position = self.argobj._getArgPosition(arg_recipient) + return self.argobj._getArgNext(recipient_position) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing argument with arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ command method ] (boolean) + # Test that the command includes requested primary command suite command (cmd_str parameter) + # cmd_str = the command string to test for in command + # arugment_required = boolean - is an argument to this command required (default = no)? + # returns boolean for presence of the cmd_str + #------------------------------------------------------------------------------------------ + def command(self, cmd_str): + try: + if (cmd_str == self.cmd): + return True + else: + return False # if command is missing, return false + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command with command() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ command_arg method ] (string) + # Return the argument to the primary command as a string + #------------------------------------------------------------------------------ + def command_arg(self): + try: + return self.arg1 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command argument with command_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ command2_arg method ] (string) + # Return the argument to the secondary command as a string + #------------------------------------------------------------------------------ + def command2_arg(self): + try: + return self.arg2 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command argument with command_arg() method (Naked.commandline.py).") + raise e + #------------------------------------------------------------------------------------------ + # [ command_with_argument method ] (boolean) + # Test that the command includes requested primary command suite command (cmd_str parameter) and argument to it + # cmd_str = the command string to test for in command + # returns boolean for presence of the cmd_str AND presence of argument to the command + #------------------------------------------------------------------------------------------ + def command_with_argument(self, cmd_str): + try: + if (cmd_str == self.cmd): + argument_to_cmd = self.argobj._getArgNext(0) + if argument_to_cmd == "": # if the argument is missing, then return false + return False + else: + return True + else: + return False # if command is missing return false + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing command and argument with command_with_argument() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ command_suite_validates method ] (boolean) + # Test that there is a primary command in a command suite application (to be used at the top level of logic for command line application) + # returns boolean for presence of the primary command + #------------------------------------------------------------------------------------------ + def command_suite_validates(self, accept_options_as_argument = True): + try: + if self.argc > 0: + if self.arg0.startswith("-") and accept_options_as_argument == False: + return False # if no command and option present, return False + else: + return True # if a primary command present, return True + else: + return False # if user only entered the application name, return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Command suite validation error with the command_suite_validation() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ flag method ] (boolean) + # Test for presence of flag in the command + #------------------------------------------------------------------------------ + def flag(self, flag_string): + try: + for match_string in self.optobj: #iterate through the options and attempt to match beginning of option to the requested flag + if match_string.startswith(flag_string): + return True + else: + pass + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing flags with the flag() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [flag_arg method] (string) + # Return the argument string assigned to a flag + #------------------------------------------------------------------------------ + def flag_arg(self, flag_string): + try: + for match_string in self.optobj: + if match_string.startswith(flag_string) and '=' in match_string: + flag_list = match_string.split("=") #split the flag on the equal symbol = list with [option, argument] + return flag_list[1] #return the argument to the flag option + else: + pass + return "" # return an empty string if unable to parse the argument + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing flags with the flag_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ flag_exists method ] (boolean) + # Test for the presence of a flag style option (--flag=argument) in the command + #------------------------------------------------------------------------------ + def flag_exists(self): + try: + for item in self.optobj: + if '=' in item: #test for presence of an = symbol in the option + return True # if present return True + break + return False # if didn't match across all options, return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing flags with the flag_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ option method ] (boolean) + # Test that the command includes an option (option_string parameter) + # option_string = the option string to test for in the command + # arugment_required = boolean - is an argument to this option required (default = no)? + # returns boolean for presence of the cmd_str + #------------------------------------------------------------------------------------------ + def option(self, option_string, argument_required = False): + try: + if (option_string in self.optobj): + argument_to_option = self.argobj._getArgNext(self.argobj._getArgPosition(option_string)) + if argument_required and ( argument_to_option == "" or argument_to_option.startswith("-") ): + return False + else: + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing option with option() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ option_arg method ] (string) + # Return the argument string to an option + #------------------------------------------------------------------------------ + def option_arg(self, option_string): + try: + return self.argobj._getArgNext(self.argobj._getArgPosition(option_string)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error returning argument to option with option_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------------------ + # [ option_with_arg method ] (boolean) + # Test that the command includes an option (option_string parameter) and argument to that option + # option_string = the option string to test for in the command + # arugment_required = boolean - is an argument to this option required (default = yes)? + # returns boolean for presence of the option_string AND the argument + #------------------------------------------------------------------------------------------ + # test that command includes an option (option_string parameter) that includes an argument (=option(option_string, True)) + def option_with_arg(self, option_string, argument_required = True): + try: + if (option_string in self.optobj): + argument_to_option = self.argobj._getArgNext(self.argobj._getArgPosition(option_string)) + if argument_required and ( argument_to_option == "" or argument_to_option.startswith("-") ): + return False # argument is either missing or is another option, return false + else: + return True + else: + return False # option is not present + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error parsing option and argument with option_with_arg() method (Naked.commandline.py).") + raise e + + #------------------------------------------------------------------------------ + # [ option_exists method ] (boolean) + # Test whether there are any options in the command string + # returns boolean value for test "Is there at least one option?" + #------------------------------------------------------------------------------ + def option_exists(self): + try: + if len(self.optobj) > 0: + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Error testing for the presence of at least one option with option_exists() method (Naked.commandline.py).") + raise e + #------------------------------------------------------------------------------ + # Naked provides the following commands for all applications that use the framework: + # -- help + # -- usage + # -- version + # These methods are accessed from the app.py module, main() as method calls on the command line object + # Parsing logic is coded below + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # Help Command/Option Handler + #------------------------------------------------------------------------------ + def help(self): + if ( (self.option("--help")) or (self.cmd == "help") or (self.option("-h")) ): + return True + else: + return False + + #------------------------------------------------------------------------------ + # Usage Command/Option Handler + #------------------------------------------------------------------------------ + def usage(self): + if ( (self.option("--usage")) or (self.cmd == "usage") ): + return True + else: + return False + + #------------------------------------------------------------------------------ + # Version Command/Option Handler + #------------------------------------------------------------------------------ + def version(self): + if ( (self.option("--version")) or (self.cmd == "version") or (self.option("-v"))): + return True + else: + return False + + #------------------------------------------------------------------------------ + # print the arguments with their corresponding argv list position to std out + #------------------------------------------------------------------------------ + def show_args(self): + x = 0 + for arg in self.argv: + print("argv[" + str(x) + "] = " + arg) + x = x + 1 + +#------------------------------------------------------------------------------ +# [ Argument Class ] +# all command line arguments (object inherited from Python list) +#------------------------------------------------------------------------------ +class Argument(list): + def __init__(self, argv): + self.argv = argv + list.__init__(self, self.argv) + + + # return argument at position specified by the 'position' parameter + def _getArg(self, position): + if ( self.argv ) and ( len(self.argv) > position ): + return self.argv[position] + else: + return "" + + # return position of user specified argument in the argument list + def _getArgPosition(self, test_arg): + if ( self.argv ): + if test_arg in self.argv: + return self.argv.index(test_arg) + else: + return -1 + + # return the argument at the next position following a user specified positional argument (e.g. for argument to an option in cmd) + def _getArgNext(self, position): + if len(self.argv) > (position + 1): + return self.argv[position + 1] + else: + return "" + +#------------------------------------------------------------------------------ +# [ Option Class ] +# Command line options (object inherited from Python list) +# Definition: string that begins with "-" (i.e. can be -h or --long) +#------------------------------------------------------------------------------ +class Option(list): + def __init__(self, argv): + self.argv = argv + list.__init__(self, self._make_option_list()) + + # make a list of the options in the command (defined as anything that starts with "-" character) + def _make_option_list(self): + optargv = [] + for x in self.argv: + if x.startswith("-"): + optargv.append(x) + return optargv diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/args.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/args.py new file mode 100644 index 00000000..739ae81d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/args.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.commandline import Command +from Naked.toolshed.system import exit_success +import shlex + +class Args: + def __init__(self, command_string): + self.com_string = command_string + + def run(self): + cmd_list = shlex.split(self.com_string) + c = Command(cmd_list[0], cmd_list[1:]) + print(' ') + print("•naked• Assuming that your Command object is instantiated as an instance named 'c', the command that you entered would be parsed as follows:") + print(' ') + print('Application') + print('-----------') + print('c.app = ' + c.app) + print(' ') + print('Argument List Length') + print('--------------------') + print('c.argc = ' + str(c.argc)) + print(' ') + print('Argument List Items') + print('-------------------') + print('c.argobj = ' + str(c.argobj)) + print(' ') + print('Arguments by Zero Indexed Start Position') + print('----------------------------------------') + print('c.arg0 = ' + c.arg0) + print('c.arg1 = ' + c.arg1) + print('c.arg2 = ' + c.arg2) + print('c.arg3 = ' + c.arg3) + print('c.arg4 = ' + c.arg4) + print(' ') + print('Arguments by Named Position') + print('---------------------------') + print('c.first = ' + c.first) + print('c.second = ' + c.second) + print('c.third = ' + c.third) + print('c.fourth = ' + c.fourth) + print('c.fifth = ' + c.fifth) + print(' ') + print('Last Positional Argument') + print('------------------------') + print('c.arglp = ' + c.arglp) + print('c.last = ' + c.last) + print(' ') + print('Primary & Secondary Commands') + print('----------------------------') + print('c.cmd = ' + c.cmd) + print('c.cmd2 = ' + c.cmd2) + print(' ') + print('Option Exists Tests') + print('------------------') + print('c.option_exists() = ' + str(c.option_exists())) + print('c.options = ' + str(c.options)) + print(' ') + print('Option Argument Assignment') + print('--------------------------') + if c.option_exists(): # if there are options, iterate through and print arguments to them + non_flag_options = False + for x in range(len(c.optobj)): + if '=' in c.optobj[x]: + continue # don't print flags, they are handled below + else: + print('c.arg("' + c.optobj[x] + '") = ' + c.arg(c.optobj[x])) + non_flag_options = True + if not non_flag_options: + print("There are no short or long options in the command.") + else: # otherwise, inform user that there are no options + print("There are no short options, long options, or flags in your command.") + print(' ') + print('Flag Exists Tests') + print('----------------') + print('c.flag_exists() = ' + str(c.flag_exists())) + print('c.flags = ' + str(c.flags)) + print(' ') + print('Flag Argument Assignment') + print('------------------------') + if c.flag_exists(): + for y in c.optobj: + if '=' in y: + the_flag = y.split('=')[0] + print('c.flag_arg("' + the_flag + '") = ' + c.flag_arg(the_flag)) + else: # provide message if there are no flags + print("There are no flag style arguments (--flag=argument) in your command.") + exit_success() + + +#------------------------------------------------------------------------------ +# [ help function ] - help for the where command +#------------------------------------------------------------------------------ +def help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked args Command Help +======================= +The args command displays information about the data that are parsed from a command string to Command object attributes and that are obtained from Command object methods. It is intended to help with the design of your application logic when you use the Naked command line parser. + +USAGE + naked args '' + +The command statement is a mandatory argument to the command. It should include a complete command as it would be entered on the command line, including the executable. The argument should be completely enclosed within quotes. + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLE + naked args 'testapp save somestring --unicode -s --name=file.txt'""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/build.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/build.py new file mode 100644 index 00000000..ef3b0d6f --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/build.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.toolshed.system import exit_success +#------------------------------------------------------------------------------ +# [ compile_c_code function ] (--none--) +# compile C files in the lib/Naked/toolshed/c directory +#------------------------------------------------------------------------------ +def compile_c_code(abs_dirpath): + from Naked.toolshed.shell import execute + from os import chdir + + chdir(abs_dirpath) + print('•naked• Compiling the C source library files...') + success = execute("python setup.py build_ext --inplace") + if success: + print(' ') + print('•naked• C source code compile complete.') + exit_success() + +def help(): + help_string = """ +Naked build Command Help +======================== +The build command compiles the Naked C libraries. This requires an installed C compiler. + +USAGE + naked build + +SECONDARY COMMANDS + none + +OPTIONS + none""" + print(help_string) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/classifier.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/classifier.py new file mode 100644 index 00000000..86c9bd00 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/classifier.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.toolshed.system import exit_success + +class Classifier: + def __init__(self, search_string): + self.needle = search_string + self.url = 'https://pypi.python.org/pypi?%3Aaction=list_classifiers' + + def run(self): + from Naked.toolshed.network import HTTP + http = HTTP(self.url) # use the python.org url for the classifier list + + print('•naked• Pulling the classifier list from python.org...') + + res = http.get() # get the list + test_list = res.split('\n') # split on newlines + + if self.needle == "": # user did not enter a search string, print the entire list + print("•naked• You did not provide a search string. Here is the entire list:") + print(' ') + for item in test_list: + print(item) + else: # user entered a search string, find it + lower_needle = self.needle.lower() + print("•naked• Performing a case insensitive search for '" + self.needle + "'") + print(' ') + filtered_list = [ x for x in test_list if lower_needle in x.lower() ] #case insensitive match for the search string + for item in filtered_list: + print(item) + + exit_success() # exit with zero status code + +def help(): + help_string = """ +Naked classify Command Help +=========================== +The classify command performs a case-insensitive search of the PyPI application classifier list and displays the results. + +USAGE + naked classify [search string] + +The search string argument is optional. If you do not include a search string, the entire classifier list is displayed. + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLES + naked classify + naked classify Internet +""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/dist.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/dist.py new file mode 100644 index 00000000..fd60855a --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/dist.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import file_exists, stderr, exit_success +from Naked.toolshed.shell import run as shell_run + +class Dist: + def __init__(self): + self.register = "python setup.py register" + self.sdist = "python setup.py sdist upload" + self.wheel = "python setup.py bdist_wheel upload" + self.swheel = "python setup.py sdist bdist_wheel upload" + self.win = "python setup.py bdist_wininst upload" + self.all = "python setup.py sdist bdist_wheel bdist_wininst upload" + + #------------------------------------------------------------------------------ + # [ run method ] - iterates through up to 6 directories above current working + # directory and then runs command if setup.py found + #------------------------------------------------------------------------------ + def run(self, command): + setuppy_found = False + for i in range(6): # navigate up at most 4 directory levels to search for the setup.py file + if not self._is_setup_py_at_this_level(): + os.chdir(os.pardir) + else: + setuppy_found = True + self._run_dist_command(command) + break + if not setuppy_found: + stderr("Unable to locate the setup.py file for your project. Please confirm that you are in your project directory and try again.", 1) + else: + exit_success() + + # search for setup.py file + def _is_setup_py_at_this_level(self): + if file_exists('setup.py'): + return True + else: + return False + + # run the user requested command + def _run_dist_command(self, the_command): + if the_command in "register": + print('•naked• Running register...') + shell_run(self.register) + elif the_command in "sdist": + print('•naked• Running sdist...') + shell_run(self.sdist) + elif the_command in "wheel": + print('•naked• Running wheel...') + shell_run(self.wheel) + elif the_command in "swheel": + print('•naked• Running swheel...') + shell_run(self.swheel) + elif the_command in "win": + print('•naked• Running win...') + shell_run(self.win) + elif the_command in "all": + print('•naked• Running all...') + shell_run(self.all) + else: + stderr("Unrecognized command. Use 'naked dist help' to view the supported commands.", 1) + + +def help(): + help_string = """ +Naked dist Command Help +======================= +The dist secondary commands run the standard distutils 'python setup.py ' source/binary distribution commands. + +USAGE + naked dist + +SECONDARY COMMANDS python setup.py + all sdist bdist_wheel bdist_wininst upload + register register + sdist sdist upload + swheel sdist bdist_wheel upload + wheel bdist_wheel upload + win bdist_wininst upload + +OPTIONS + none + +EXAMPLES + naked dist register + naked dist sdist""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/help.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/help.py new file mode 100644 index 00000000..bc552430 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/help.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.settings +from Naked.toolshed.system import exit_success + +class Help: + def __init__(self): + self.help = Naked.settings.help + + def print_help(self): + print(self.help) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/locate.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/locate.py new file mode 100644 index 00000000..d490efd8 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/locate.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import stderr, exit_success + +class Locator: + def __init__(self, needle): + self.needle = needle + self.location = self._display_location() + + def _display_location(self): + if self.needle == 'main': + main_path = os.path.join('', 'lib', '', 'app.py') + print("app.py : " + main_path) + exit_success() + elif self.needle == "settings": + settings_path = os.path.join('', 'lib', '','settings.py') + print("settings.py : " + settings_path) + exit_success() + elif self.needle == "setup": + setup_path = os.path.join('', 'setup.py') + print("setup.py : " + setup_path) + exit_success() + else: + stderr("Unable to process the command. Use 'naked locate help' for more information.", 1) + +def help(): + help_string = """ +Naked locate Command Help +========================= +The locate command identifies the file path to commonly used files in your project directory. + +USAGE + naked locate + +SECONDARY COMMANDS + main - the main application script file, app.py + setup - the setup.py file + settings - the project settings files, settings.py + +OPTIONS + none + +EXAMPLE + naked locate main""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/make.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/make.py new file mode 100644 index 00000000..def59ff4 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/make.py @@ -0,0 +1,388 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.toolshed.system as system +import Naked.toolshed.python as python +import Naked.toolshed.file as nfile +import Naked.toolshed.ink as ink +from Naked.toolshed.types import XDict, XString +from Naked.toolshed.system import make_dirs, make_path, exit_success +import datetime +import sys + +## TODO: Check for a local settings file (appname.yaml) +## TODO: make directories and files +#------------------------------------------------------------------------------ +# [ MakeController class ] +# Top level logic for the make command +#------------------------------------------------------------------------------ +class MakeController: + def __init__(self, app_name): + self.app_name = app_name + + def run(self): + if self.app_name == None: + i = InfoCompiler(None) + data_container = i.getSetupFileInfo() + else: + i = InfoCompiler(self.app_name) + data_container = i.getUserInfo() + + db = DirectoryBuilder(data_container) + db.build() + fb = FileBuilder(data_container) + if fb.build_and_write(): # file writes were successful + main_script_path = make_path(data_container.app_name, 'lib', data_container.app_name, 'app.py') + settings_path = make_path(data_container.app_name, 'lib', data_container.app_name, 'settings.py') + command_dir = make_path(data_container.app_name, 'lib', data_container.app_name, 'commands') + setuppy_path = make_path(data_container.app_name, 'setup.py') + print(" ") + print(data_container.app_name + " was successfully built.") + print(" ") + print("-----") + print("Main application script: " + main_script_path) + print("Settings file: " + settings_path) + print("Commands directory: " + command_dir) + print("setup.py file: " + setuppy_path) + print("-----") + print(" ") + print("Use 'python setup.py develop' from the top level of your project and you can begin testing your application with the executable, " + data_container.app_name) + exit_success() +#------------------------------------------------------------------------------ +# [ InfoCompiler class ] +# obtain information from user in order to build a new project +#------------------------------------------------------------------------------ +class InfoCompiler: + def __init__(self, app_name): + self.data = DataContainer() + self.data.app_name = app_name + self.displayed_info_flag = 0 + + def getUserInfo(self): + if not self.displayed_info_flag: + print("We need some information to create your project.") + self.displayed_info_flag = 1 + # If no project name, then query for it because this is mandatory + if self.data.app_name == None: + if python.is_py2: + response = raw_input("Please enter your application name (q=quit): ") + else: + response = input("Please enter your application name (q=quit): ") + if len(response) > 0: + if response == "q": + print("Aborted project build.") + sys.exit(0) # user requested quit + else: + if len(response.split()) > 1: # if more than one word + print("The application name must be a single word. Please try again.") + self.getUserInfo() + else: + self.data.app_name = response + else: + print("The Naked project will not build without an application name. Please try again.") + return self.getUserInfo() + # if project name already set, then obtain the other optional information + if python.is_py2(): + self.data.developer = raw_input("Enter the licensing developer or organization (q=quit): ") + if self.data.developer == "q": + print("Aborted the project build.") + sys.exit(0) + self.data.license = raw_input("Enter the license type (or leave blank, q=quit): ") + if self.data.license == "q": + print("Aborted the project build.") + sys.exit(0) + else: + self.data.developer = input("Enter the licensing developer or organization: ") + if self.data.developer == "q": + print("Aborted the project build.") + sys.exit(0) + self.data.license = input("Enter the license type (or leave blank): ") + if self.data.license == "q": + print("Aborted the project build.") + sys.exit(0) + if self.confirmData(): + return self.data + else: + print("Let's try again...") + return self.getUserInfo() # try again + + def getSetupFileInfo(self): + files = system.list_all_files_cwd() + if len(files) > 0: + setupfile_exists = False + for a_file in files: + if 'naked.yaml' == a_file.lower(): # accepts any permutation of upper/lower case 'naked.yaml' + print("Detected a Naked project YAML setup file (" + a_file + ").") + setupfile_exists = True + fr = nfile.FileReader(a_file) + the_yaml = fr.read_utf8() + self.parseYaml(the_yaml) + if setupfile_exists: + if self.confirmData(): + return self.data + else: + print("Aborted the project build.") + if python.is_py2(): + response = raw_input("Would you like to modify this information? (y/n) ") + else: + response = input("Would you like to modify this information? (y/n) ") + if response in ['y', 'Y', 'Yes', 'YES', 'yes']: + self.displayed_info_flag = 1 + self.data.app_name = None + return self.getUserInfo() # return the result from the getUserInfo command to the calling method + else: + sys.exit(0) + else: + return self.getUserInfo() # there are files but no setup file, use the manual entry method + else: + return self.getUserInfo() # there are no files in the directory, use the manual entry method + + + def parseYaml(self, yaml_string): + import yaml + the_yaml = yaml.load(yaml_string) + # Parse project name + if 'application' in the_yaml: + self.data.app_name = the_yaml['application'] + else: + print("Unable to find the application name ('application' field) in naked.yaml") + if python.is_py2: + response = raw_input("Please enter your application name: ") + else: + response = input("Please enter your application name: ") + if len(response) > 0: + self.data.app_name = response # assign the application name at CL if was not entered in file + else: + print("The Naked project will not build without an application name. Please try again.") + self.displayed_info_flag = 1 + self.getUserInfo() + # Parse developer + if 'developer' in the_yaml: + self.data.developer = the_yaml['developer'] # set developer + else: + self.data.developer = "" + # Parse license type + if 'license' in the_yaml: + self.data.license = the_yaml['license'] # set license + else: + self.data.license = "" + + + def confirmData(self): + templ_str = getHeaderTemplate() + template = ink.Template(templ_str) + renderer = ink.Renderer(template, {'app_name': self.data.app_name, 'developer': self.data.developer, 'license': self.data.license, 'year': self.data.year}) + display_header = renderer.render() + print("\nPlease confirm the information below:") + print(display_header) + + if python.is_py2(): + response = raw_input("Is this correct? (y/n) ") + else: + response = input("Is this correct? (y/n) ") + + if response in ['y', 'Y', 'yes', 'YES']: + return True + else: + self.data.app_name = None + return False + +#------------------------------------------------------------------------------ +# [ getHeaderTemplate function ] (string) +# returns the Ink header template for user confirmation +#------------------------------------------------------------------------------ +def getHeaderTemplate(): + templ_str = """ +---------------------------------------------------------- + {{app_name}} + Copyright {{year}} {{developer}} + {{license}} +---------------------------------------------------------- + """ + return templ_str + +#------------------------------------------------------------------------------ +# [ DataContainer class ] +# state maintenance object that holds project information +#------------------------------------------------------------------------------ +class DataContainer: + def __init__(self): + self.cwd = system.cwd() + self.year = str(datetime.datetime.now().year) + +#------------------------------------------------------------------------------ +# [ DirectoryBuilder class ] +# generation of directory structure for a new project +#------------------------------------------------------------------------------ +class DirectoryBuilder: + def __init__(self, data_container): + self.data_container = data_container + + def build(self): + top_level_dir = self.data_container.app_name + second_level_dirs = ['docs', 'lib', 'tests'] + lib_subdir = make_path(self.data_container.app_name, 'commands') + + for xdir in second_level_dirs: + make_dirs(make_path(top_level_dir, xdir)) + + make_dirs(make_path(top_level_dir, 'lib', lib_subdir)) + +#------------------------------------------------------------------------------ +# [ FileBuilder class ] +# generate the files for a new project +#------------------------------------------------------------------------------ +class FileBuilder: + def __init__(self, data_container): + self.data_container = data_container + self.file_dictionary = {} + + def build_and_write(self): + self._make_file_paths() # create the file paths for all generated files + self._render_file_strings() # create the rendered template strings + self._make_file_dictionary() # make the file path : file string dictionary + self.write_files() # write out to files + return True # if made it this far without exception, return True to calling method to confirm file writes + + # files are included in self.file_dictionary as key = filepath, value = filestring pairs + # write the files to disk + def write_files(self): + the_file_xdict = XDict(self.file_dictionary) + for filepath, file_string in the_file_xdict.xitems(): + fw = nfile.FileWriter(filepath) + try: + fw.write_utf8(file_string) + except TypeError as te: # catch unicode write errors + fw.write(file_string) + + def _make_file_paths(self): + from Naked.toolshed.system import make_path + + self.top_manifestin = make_path(self.data_container.app_name, 'MANIFEST.in') + self.top_readmemd = make_path(self.data_container.app_name, 'README.md') + self.top_setupcfg = make_path(self.data_container.app_name, 'setup.cfg') + self.top_setuppy = make_path(self.data_container.app_name, 'setup.py') + self.docs_license = make_path(self.data_container.app_name, 'docs', 'LICENSE') + self.docs_readmerst = make_path(self.data_container.app_name, 'docs', 'README.rst') + self.lib_initpy = make_path(self.data_container.app_name, 'lib', '__init__.py') + self.com_initpy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, 'commands', '__init__.py') + self.tests_initpy = make_path(self.data_container.app_name, 'tests', '__init__.py') + self.lib_profilerpy = make_path(self.data_container.app_name, 'lib', 'profiler.py') + self.lib_proj_initpy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, '__init__.py') + self.lib_proj_apppy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, 'app.py') + self.lib_proj_settingspy = make_path(self.data_container.app_name, 'lib', self.data_container.app_name, 'settings.py') + + def _render_file_strings(self): + from Naked.templates.manifest_in_file import manifest_file_string + from Naked.templates.readme_md_file import readme_md_string + from Naked.templates.setup_cfg_file import setup_cfg_string + from Naked.templates.setup_py_file import setup_py_string + from Naked.templates.profiler_file import profiler_file_string + from Naked.templates.app_file import app_file_string + from Naked.templates.settings_file import settings_file_string + + data_dict = self.data_container.__dict__ + + self.top_manifestin_rendered = manifest_file_string # no replacements necessary + self.top_readmemd_rendered = self._render_template(self._create_template(readme_md_string), data_dict) #requires app_name replacement + self.top_setupcfg_rendered = setup_cfg_string # no replacement necessary + self.top_setuppy_rendered = self._render_template(self._create_template(setup_py_string), data_dict) # requires app_name, developer replacements + self.docs_readmerst_rendered = "" # blank document stub write + self.lib_profilerpy_rendered = profiler_file_string # no replacement necessary + self.initpy_rendered = "" # blank __init__.py files + self.lib_proj_apppy_rendered = self._render_template(self._create_template(app_file_string), data_dict) # requires app_name, developer, license_name, year replacements + self.lib_proj_settingspy_rendered = self._render_template(self._create_template(settings_file_string), data_dict) # requires app_name replacement + + if len(self.data_container.license) > 0: + license = self.parse_licenses(self.data_container.license) # find the appropriate license template if the license was provided by user + if len(license) > 0: # could be empty string if fails to match a license template provided by Naked + self.docs_license_rendered = self._render_template(self._create_template(license), data_dict) + else: + self.docs_license_rendered = "" + + def _make_file_dictionary(self): + file_dictionary = {} + ## File path : file string key/value pairs > make as XString and encode as unicode for unicode file writes + file_dictionary[self.top_manifestin] = XString(self.top_manifestin_rendered).unicode().strip() + file_dictionary[self.top_readmemd] = XString(self.top_readmemd_rendered).unicode().strip() + file_dictionary[self.top_setupcfg] = XString(self.top_setupcfg_rendered).unicode().strip() + file_dictionary[self.top_setuppy] = XString(self.top_setuppy_rendered).unicode().strip() + file_dictionary[self.docs_license] = XString(self.docs_license_rendered).unicode().strip() + file_dictionary[self.docs_readmerst] = XString(self.docs_readmerst_rendered).unicode().strip() + file_dictionary[self.lib_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.com_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.tests_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.lib_profilerpy] = XString(self.lib_profilerpy_rendered).unicode().strip() + file_dictionary[self.lib_proj_initpy] = XString(self.initpy_rendered).unicode().strip() + file_dictionary[self.lib_proj_apppy] = XString(self.lib_proj_apppy_rendered).unicode().strip() + file_dictionary[self.lib_proj_settingspy] = XString(self.lib_proj_settingspy_rendered).unicode().strip() + + self.file_dictionary = file_dictionary + + def _create_template(self, template_string): + return ink.Template(template_string) + + def _render_template(self, template, key_dict): + r = ink.Renderer(template, key_dict) + return r.render() + + def parse_licenses(self, license_string): + if len(license_string) > 0: + license = license_string.lower() # case insensitive matching, make lower case version + + if license.startswith('apache'): + from Naked.templates.licenses import apache_license + return apache_license + elif license.startswith('bsd'): + from Naked.templates.licenses import bsd_license + return bsd_license + elif license.startswith('gpl'): + from Naked.templates.licenses import gpl3_license + return gpl3_license + elif license.startswith('lgpl'): + from Naked.templates.licenses import lgpl_license + return lgpl_license + elif license.startswith('mit'): + from Naked.templates.licenses import mit_license + return mit_license + elif license.startswith('mozilla'): + from Naked.templates.licenses import mozilla_license + return mozilla_license + else: + return "" + +def help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked make Command Help +======================= +The make command builds a new Naked project. The project can be built from either responses that you give on the command line, or from a naked.yaml project settings file. + +USAGE + naked make [argument] + +The command should be run in the top level of the path where you would like to create your project. The argument to the make command is optional. If used, this is the name of your new project. It is not necessary to include the argument if you use a naked.yaml project settings file. + +The naked.yaml settings file has the following structure: + + application: + developer: + license: + +Place this in the top level of an empty directory and use `naked make` in the same directory. Naked will confirm your settings and then build the project directories and files from these settings. + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLES + naked make + naked make testapp""" + print(help_string) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/profile.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/profile.py new file mode 100644 index 00000000..47e8451f --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/profile.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import file_exists, dir_exists, stderr, exit_success + +class Profiler: + def __init__(self, dir_levels = 6): + self.number_of_dir_levels = dir_levels # number of directory levels to bottom to top search + + def run(self): + lib_found = False + for i in range(self.number_of_dir_levels): + if not self._is_lib_at_this_level(): + os.chdir(os.pardir) + else: + lib_found = True + break + if lib_found: + os.chdir('lib') # chdir to the lib directory if it is found + if file_exists('profiler.py'): # confirm that profiler.py exists + os.system('python profiler.py') # run the profiler.py file + exit_success() + else: + stderr("Unable to locate a profiler.py file in your lib directory.", 1) + else: + stderr("Unable to locate your profiler.py file. Please navigate to your project directory.", 1) + + def _is_lib_at_this_level(self): + if dir_exists('lib'): + return True + else: + return False + + +def help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked profile Command Help +========================== +The profile command runs cProfile and pstats on the code that you enter in test code block of your PROJECT/lib/profiler.py file. + +USAGE + naked profile + +SECONDARY COMMANDS + none + +OPTIONS + none + +This command searches bottom to top (from the working directory) through up to 6 directory levels to identify the lib/profiler.py path.""" + + print(help_string) + exit_success() + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/pyh.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/pyh.py new file mode 100644 index 00000000..674506f8 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/pyh.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys + +def python_help(help_string): + try: + needle = help_string + if needle.startswith("'") and needle.endswith("'"): + needle = needle[1:-1] + elif needle.startswith('"') and needle.endswith('"'): + needle = needle[1:-1] + help(needle) + except Exception as e: + print(e) + sys.stderr.write("•naked• There was an error processing the query.") + sys.exit(1) + +def pyh_help(): + from Naked.toolshed.system import exit_success + help_string = """ +Naked pyh Command Help +====================== +The pyh command searches the built-in Python documentation for a query term. The query term can be a Python built-in module, class/type, method, or function. + +USAGE + naked pyh + +SECONDARY COMMANDS + none + +OPTIONS + none + +EXAMPLES + Module Docs: naked pyh sys + + Class Docs: naked pyh dict + + Method Docs: naked pyh dict.update + + Function Docs: naked pyh max""" + + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/test.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/test.py new file mode 100644 index 00000000..6d292008 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/test.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +from Naked.toolshed.system import cwd, file_exists, dir_exists, stderr, exit_success + +#------------------------------------------------------------------------------ +# [ ToxTester class ] +# Run Tox on the project directory, by default runs all python versions in tox.ini +# Optional specify the version of Python to test in constructor (runs 'tox -e py') +# Optional specify the number of directory levels `dir_levels` to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class ToxTester: + def __init__(self, py_version="", dir_levels = 6): + self.py_version = py_version + self.number_of_dir_levels = dir_levels + + def run(self): + tox_found = False + for i in range(self.number_of_dir_levels): + if not self._is_tox_ini_at_this_level(): + os.chdir(os.pardir) + else: + tox_found = True + self._run_tox() + break + if not tox_found: + stderr("Unable to locate your tox.ini file. Please navigate to your project directory.", 1) + else: + exit_success() + + def _is_tox_ini_at_this_level(self): + if file_exists('tox.ini'): + return True + else: + return False + + def _run_tox(self): + if self.py_version == "": + os.system("tox") + else: + cmd_string = "tox -e" + self.py_version + os.system(cmd_string) + +#------------------------------------------------------------------------------ +# [ NoseTester class ] +# run nose tests from the tests directory (works from any level of the project) +# Optional specify the number of directory levels to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class NoseTester: + def __init__(self, dir_levels = 6): + self.number_of_dir_levels = dir_levels + + def run(self): + nose_found = False + for i in range(self.number_of_dir_levels): + if not self._is_testdir_at_this_level(): + os.chdir(os.pardir) + else: + nose_found = True + self._run_nose() + break + if not nose_found: + stderr("Unable to locate your testing directory", 1) + else: + exit_success() + + def _is_testdir_at_this_level(self): + if file_exists('setup.py'): + if dir_exists('tests'): + return True + else: + return False #found setup.py but no tests directory + else: + return False # setup.py not at this level + + def _run_nose(self): + os.system("nosetests --where=tests") + + +#------------------------------------------------------------------------------ +# [ PyTester class ] +# run py.test test runner in the tests directory +# Optional specify the number of directory levels to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class PyTester: + def __init__(self, dir_levels = 6): + self.number_of_dir_levels = dir_levels + + def run(self): + py_found = False + for i in range(self.number_of_dir_levels): + if not self._is_testdir_at_this_level(): + os.chdir(os.pardir) + else: + py_found = True + self._run_pytests() + break + if not py_found: + stderr("Unable to locate your testing directory", 1) + else: + exit_success() + + def _is_testdir_at_this_level(self): + if file_exists('setup.py'): + if dir_exists('tests'): + return True + else: + return False + else: + return False + + def _run_pytests(self): + os.chdir('tests') + os.system('py.test') + +#------------------------------------------------------------------------------ +# [ UnitTester class ] +# run Python unit tests with the built in unittest methods +# Optional specify the number of directory levels to search bottom to top (default = 4) +#------------------------------------------------------------------------------ +class UnitTester: + def __init__(self, the_unit_test, dir_levels = 6): + self.unittest = the_unit_test + self.number_of_dir_levels = dir_levels + + def run(self): + unit_found = False + for i in range(self.number_of_dir_levels): + if not self._is_testdir_at_this_level(): + os.chdir(os.pardir) + else: + unit_found = True + os.chdir('tests') + if file_exists(self.unittest): + self._run_unittest() + else: + stderr("The unit test file " + self.unittest + " could not be found in the tests directory.") + if not unit_found: + stderr("Unable to locate your testing directory", 1) + else: + exit_success() + + def _is_testdir_at_this_level(self): + if file_exists('setup.py'): + if dir_exists('tests'): + return True + else: + return False + else: + return False + + def _run_unittest(self): + cmd_string = "python " + self.unittest + os.system(cmd_string) + + +def help(): + help_string = """ +Naked test Command Help +======================= +The test command allows you to run unit tests from any working directory in your project. + +USAGE + naked test [argument] + +SECONDARY COMMANDS + nose - run the nose test runner on your project + pytest - run the py.test test runner on your project + tox - run the tox test runner on your project + unittest - run Python unit tests (built-in) + +ARGUMENTS + nose + -- does not take additional arguments + + pytest + -- does not take additional arguments + + tox [python version] + -- You can include an optional tox Python version argument to run your + tests with a single version of Python (instead of the versions + specified in the tox.ini file). By default, the versions specified + in your tox.ini file are run. + + unittest + -- Mandatory unit test file path (relative to the tests directory) + +OPTIONS + none + +EXAMPLES + naked test nose + naked test pytest + naked test tox + naked test tox py27 + naked test unittest test_app.py + +A bottom to top search (from the working directory) is performed over up to 6 directory levels to find the 'tests' directory.""" + print(help_string) + exit_success() + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/usage.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/usage.py new file mode 100644 index 00000000..d297bdd3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/usage.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.settings +from Naked.toolshed.system import exit_success + +class Usage: + def __init__(self): + self.usage = Naked.settings.usage + + def print_usage(self): + print(self.usage) + exit_success() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/version.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/version.py new file mode 100644 index 00000000..46737f4e --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/commands/version.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import Naked.settings +from Naked.toolshed.system import exit_success + +class Version: + def __init__(self): + self.major_version = Naked.settings.major_version + self.minor_version = Naked.settings.minor_version + self.patch_version = Naked.settings.patch_version + self.name = Naked.settings.app_name + self.app_version_string = self.name + " " + self.major_version + "." + self.minor_version + "." + self.patch_version + self.version_string = self.major_version + "." + self.minor_version + "." + self.patch_version + + def print_version(self): + print(self.app_version_string) + exit_success() + + def get_version(self): + return self.version_string + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/scratchpad.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/scratchpad.py new file mode 100644 index 00000000..cb263482 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/scratchpad.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# import sys +# from functools import wraps +# from Naked.toolshed.types import XMaxHeap, XMinHeap + +# def print_scratch(func): +# @wraps(func) +# def print_wrapper(*args, **kwargs): +# print(func(*args, **kwargs)) +# return print_wrapper + + +# def run_scratchpad(): +# # from Naked.toolshed.file import FileReader +# # from Naked.toolshed.types import XString, XUnicode + +# # r = FileReader('/Users/ces/Desktop/code/naked/tests/testfiles/unicode.txt') +# # test1 = r.read_utf8() +# # test2 = XUnicode(test1, {'a': 'b'}) +# # test3 = "Hey! It's Bengali ব য,and here is some more ২" +# # print(unicode(test2)) + + + +# if __name__ == '__main__': +# run_scratchpad() diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/settings.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/settings.py new file mode 100644 index 00000000..e5daabdd --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/settings.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# Application Name +#------------------------------------------------------------------------------ +app_name = "naked" + +#------------------------------------------------------------------------------ +# Version Number +#------------------------------------------------------------------------------ +major_version = "0" +minor_version = "1" +patch_version = "31" + +#------------------------------------------------------------------------------ +# Debug Flag (switch to False for production release code) +#------------------------------------------------------------------------------ +debug = False + +#------------------------------------------------------------------------------ +# Usage String +#------------------------------------------------------------------------------ +usage = """ +Usage: naked [secondary command] [option(s)] [argument(s)] +--- Use 'naked help' for detailed help --- +""" + +#------------------------------------------------------------------------------ +# Help String +#------------------------------------------------------------------------------ +help = """ +--------------------------------------------------- + Naked + A Python command line application framework + Copyright 2014 Christopher Simpkins + MIT license +--------------------------------------------------- + +ABOUT + +The Naked framework includes the "naked" executable and the Python toolshed library. The naked executable is a command line tool for application development, testing, profiling, and deployment. The toolshed library contains numerous useful tools for application development that can be used through standard Python module imports. These features are detailed in the documentation (link below). + +USAGE + +The naked executable syntax is: + + naked [secondary command] [option(s)] [argument(s)] + +The is mandatory and includes one of the commands in the following section. The [bracketed] syntax structure is optional and dependent upon the primary command that you use. Use the command 'naked help' for details about a command. + +PRIMARY COMMANDS SECONDARY COMMANDS + + args help + build help + classify help + dist all•help•sdist•swheel•wheel•win + help - none - + locate main•help•settings•setup + make help + profile help + pyh help + test nose•pytest•tox•unittest + usage - none - + version - none - + +HELP + +To learn more about a primary command, use the following syntax: + + naked help + +DOCUMENTATION + + http://docs.naked-py.com + +SOURCE REPOSITORY + + https://github.com/chrissimpkins/naked + +ISSUE REPORTING + + https://github.com/chrissimpkins/naked/issues + +""" + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/app_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/app_file.py new file mode 100644 index 00000000..ff5cf42c --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/app_file.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = app_name, developer, license_name, year +app_file_string = """ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# {{app_name}} +# Copyright {{year}} {{developer}} +# {{license}} +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------------ +# c.cmd = Primary command ({{app_name}} ) +# c.cmd2 = Secondary command ({{app_name}} ) +# +# c.arg_to_cmd = first positional argument to the primary command +# c.arg_to_cmd2 = first positional argument to the secondary command +# +# c.option(option_string, [bool argument_required]) = test for option with optional positional argument to option test +# c.option_with_arg(option_string) = test for option and mandatory positional argument to option +# c.flag(flag_string) = test for presence of a "option=argument" style flag +# +# c.arg(arg_string) = returns the next positional argument to the arg_string argument +# c.flag_arg(flag_string) = returns the flag assignment for a "--option=argument" style flag +#------------------------------------------------------------------------------------ + +# Application start +def main(): + import sys + from Naked.commandline import Command + from Naked.toolshed.state import StateObject + + #------------------------------------------------------------------------------------------ + # [ Instantiate command line object ] + # used for all subsequent conditional logic in the CLI application + #------------------------------------------------------------------------------------------ + c = Command(sys.argv[0], sys.argv[1:]) + #------------------------------------------------------------------------------ + # [ Instantiate state object ] + #------------------------------------------------------------------------------ + state = StateObject() + #------------------------------------------------------------------------------------------ + # [ Command Suite Validation ] - early validation of appropriate command syntax + # Test that user entered at least one argument to the executable, print usage if not + #------------------------------------------------------------------------------------------ + if not c.command_suite_validates(): + from {{app_name}}.settings import usage as {{app_name}}_usage + print({{app_name}}_usage) + sys.exit(1) + #------------------------------------------------------------------------------------------ + # [ NAKED FRAMEWORK COMMANDS ] + # Naked framework provides default help, usage, and version commands for all applications + # --> settings for user messages are assigned in the lib/{{app_name}}/settings.py file + #------------------------------------------------------------------------------------------ + if c.help(): # User requested {{app_name}} help information + from {{app_name}}.settings import help as {{app_name}}_help + print({{app_name}}_help) + sys.exit(0) + elif c.usage(): # User requested {{app_name}} usage information + from {{app_name}}.settings import usage as {{app_name}}_usage + print({{app_name}}_usage) + sys.exit(0) + elif c.version(): # User requested {{app_name}} version information + from {{app_name}}.settings import app_name, major_version, minor_version, patch_version + version_display_string = app_name + ' ' + major_version + '.' + minor_version + '.' + patch_version + print(version_display_string) + sys.exit(0) + #------------------------------------------------------------------------------------------ + # [ PRIMARY COMMAND LOGIC ] + # Enter your command line parsing logic below + #------------------------------------------------------------------------------------------ + + # [[ Example usage ]] ------------------------------->>> + # if c.cmd == 'hello': + # if c.cmd2 = 'world': + # if c.option('--print'): + # print('Hello World!') + # elif c.cmd == 'spam': + # if c.option_with_arg('--with'): + # friend_of_spam = c.arg('--with') # user enters {{app_name}} spam --with eggs + # print('spam and ' + friend_of_spam) # prints 'spam and eggs' + # elif c.cmd == 'naked': + # if c.flag("--language"): + # lang = c.flag_arg("--language") # user enters {{app_name}} naked --language=python + # print("Naked & " + lang) # prints 'Naked & python' + # End example --------------------------------------->>> + + #------------------------------------------------------------------------------------------ + # [ DEFAULT MESSAGE FOR MATCH FAILURE ] + # Message to provide to the user when all above conditional logic fails to meet a true condition + #------------------------------------------------------------------------------------------ + else: + print("Could not complete the command that you entered. Please try again.") + sys.exit(1) #exit + +if __name__ == '__main__': + main() +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/licenses.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/licenses.py new file mode 100644 index 00000000..dfcbd7b4 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/licenses.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# ALL LICENSES: VARS = year, developer + +#------------------------------------------------------------------------------ +# [ apache_license ] +# The Apache License +#------------------------------------------------------------------------------ +apache_license = """ +Copyright {{year}} {{developer}} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +#------------------------------------------------------------------------------ +# [ bsd_license ] +# The BSD 2-clause license +#------------------------------------------------------------------------------ +bsd_license = """ +Copyright (c) {{year}}, {{developer}} +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +""" + +#------------------------------------------------------------------------------ +# [ gpl3_license ] +# The GPL v3 License +#------------------------------------------------------------------------------ +gpl3_license = """ +Copyright (C) {{year}} {{developer}} + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see [http://www.gnu.org/licenses/]. +""" + +#------------------------------------------------------------------------------ +# [lgpl_license ] +# The Lesser GPL license +#------------------------------------------------------------------------------ +lgpl_license = """ +Copyright (C) {{year}} {{developer}} + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +USA +""" + +#------------------------------------------------------------------------------ +# [ mit_license ] +# The MIT License +#------------------------------------------------------------------------------ +mit_license = """ +The MIT License (MIT) + +Copyright (c) {{year}} {{developer}} + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" + +#------------------------------------------------------------------------------ +# [ mozilla_license ] +# The Mozilla Public license, v2.0 +#------------------------------------------------------------------------------ +mozilla_license = """ +Mozilla Public License, v.2.0 + +Copyright (c) {{year}} {{developer}} + +This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. + +If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +""" + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/manifest_in_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/manifest_in_file.py new file mode 100644 index 00000000..16e1454d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/manifest_in_file.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = --none-- +manifest_file_string = "recursive-include docs *" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/profiler_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/profiler_file.py new file mode 100644 index 00000000..2b5cceed --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/profiler_file.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = --none-- +profiler_file_string = """ +#!/usr/bin/env python +# encoding: utf-8 + +import cProfile, pstats, StringIO + +def profile(): + #------------------------------------------------------------------------------ + # Setup a profile + #------------------------------------------------------------------------------ + pr = cProfile.Profile() + #------------------------------------------------------------------------------ + # Enter setup code below + #------------------------------------------------------------------------------ + # Optional: include setup code here + + + #------------------------------------------------------------------------------ + # Start profiler + #------------------------------------------------------------------------------ + pr.enable() + + #------------------------------------------------------------------------------ + # BEGIN profiled code block + #------------------------------------------------------------------------------ + # include profiled code here + + + #------------------------------------------------------------------------------ + # END profiled code block + #------------------------------------------------------------------------------ + pr.disable() + s = StringIO.StringIO() + sortby = 'cumulative' + ps = pstats.Stats(pr, stream=s).sort_stats(sortby) + ps.strip_dirs().sort_stats("time").print_stats() + print(s.getvalue()) + +if __name__ == '__main__': + profile() +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/pypush_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/pypush_file.py new file mode 100644 index 00000000..414c3cd2 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/pypush_file.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = year +pypush_file_string = """ +#!/bin/sh +# Scriptacular - pypush.sh +# Create a Python source distribution and push it to PyPI +# Copyright {{year}} Christopher Simpkins +# MIT License + + +# Build and push to PyPI +python setup.py sdist upload + +# Confirm that it worked +if (( $? )); then + echo "Unable to distribute your release to PyPI" >&2 + exit 1 +fi + +python setup.py bdist_wheel upload + +# Confirm that wheel distribution worked +if (( $? )); then + echo "Unable to distribute your wheel to PyPI" >&2 + exit 1 +fi + +# Exit success +exit 0 +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/readme_md_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/readme_md_file.py new file mode 100644 index 00000000..4bb5b0f6 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/readme_md_file.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS: app_name +readme_md_string = """ +{{app_name}} +===== +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/settings_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/settings_file.py new file mode 100644 index 00000000..ba5fddf8 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/settings_file.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS = app_name +settings_file_string = """ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# Application Name +#------------------------------------------------------------------------------ +app_name = '{{app_name}}' + +#------------------------------------------------------------------------------ +# Version Number +#------------------------------------------------------------------------------ +major_version = "0" +minor_version = "1" +patch_version = "0" + +#------------------------------------------------------------------------------ +# Debug Flag (switch to False for production release code) +#------------------------------------------------------------------------------ +debug = True + +#------------------------------------------------------------------------------ +# Usage String +#------------------------------------------------------------------------------ +usage = '' + +#------------------------------------------------------------------------------ +# Help String +#------------------------------------------------------------------------------ +help = '' +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_cfg_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_cfg_file.py new file mode 100644 index 00000000..b3c096d1 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_cfg_file.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS: --none-- +setup_cfg_string = """ +[wheel] +universal = 1 +""" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_py_file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_py_file.py new file mode 100644 index 00000000..3b1bc541 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/templates/setup_py_file.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# encoding: utf-8 + +# VARS: app_name, developer, license +setup_py_string = (""" +import os +import re +from setuptools import setup, find_packages + + +def docs_read(fname): + return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read() + +def version_read(): + settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', '{{app_name}}', 'settings.py')).read() + major_regex = """ + '"""' + """major_version\s*?=\s*?["']{1}(\d+)["']{1}""" + '"""' + '\n ' + + 'minor_regex = ' + '"""' + """minor_version\s*?=\s*?["']{1}(\d+)["']{1}""" + '"""' + '\n ' + + 'patch_regex = ' + '"""' + """patch_version\s*?=\s*?["']{1}(\d+)["']{1}""" + '"""' + '\n ' + + """major_match = re.search(major_regex, settings_file) + minor_match = re.search(minor_regex, settings_file) + patch_match = re.search(patch_regex, settings_file) + major_version = major_match.group(1) + minor_version = minor_match.group(1) + patch_version = patch_match.group(1) + if len(major_version) == 0: + major_version = 0 + if len(minor_version) == 0: + minor_version = 0 + if len(patch_version) == 0: + patch_version = 0 + return major_version + "." + minor_version + "." + patch_version + + +setup( + name='{{app_name}}', + version=version_read(), + description='', + long_description=(docs_read('README.rst')), + url='', + license='{{license}}', + author='{{developer}}', + author_email='', + platforms=['any'], + entry_points = { + 'console_scripts': [ + '{{app_name}} = {{app_name}}.app:main' + ], + }, + packages=find_packages("lib"), + package_dir={'': 'lib'}, + install_requires=['Naked'], + keywords='', + include_package_data=True, + classifiers=[], +) +""") diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/benchmarking.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/benchmarking.py new file mode 100644 index 00000000..63878bc0 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/benchmarking.py @@ -0,0 +1,463 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import time +import gc +from functools import wraps + +#------------------------------------------------------------------------------ +# [ timer function decorator ] +# runs timed repetitions of the decorated function in a single trial +# default is 100,000 repetitions in the trial +# reports the results of the trial +# Usage example: +# from Naked.toolshed.benchmarking import timer +# @timer +# def myfunction(): +#------------------------------------------------------------------------------ +def timer(func, repetitions=100000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_X function decorators ] +# replicate the above decorator with different number of repetitions +#------------------------------------------------------------------------------ + +def timer_10(func, repetitions=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_100(func, repetitions=100): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1k(func, repetitions=1000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_10k(func, repetitions=10000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1m(func, repetitions=1000000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark decorator function ] +# time a function and compare to a benchmark function +# default is 10 trials x 100,000 repetitions/trial for each function +# Results: +# - Mean of the 10 trials of the test function +# - standard deviation of the 10 trials (if numpy is available) +# - result for 100,000 repetitions of the benchmark function +# - ratio of the test : benchmark function results +# Usage example: +# from Naked.toolshed.benchmarking import timer_trials_benchmark +# @timer_trials_benchmark +# def myfunction(): +#------------------------------------------------------------------------------ +def timer_trials_benchmark(func, repetitions=100000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark_X decorators ] +# additional benchmark decorators that replicate the above function with different # repetitions +#------------------------------------------------------------------------------ +def timer_trials_benchmark_10(func, repetitions=10, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_100(func, repetitions=100, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.c new file mode 100644 index 00000000..c17440d5 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.c @@ -0,0 +1,16546 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:12 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__benchmarking +#define __PYX_HAVE_API__lib__Naked__toolshed__c__benchmarking +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "benchmarking.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m; + +/* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + + +/* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m { + PyObject_HEAD + PyObject *__pyx_v_func; + PyObject *__pyx_v_repetitions; + PyObject *__pyx_v_trials; +}; + +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#include + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.benchmarking' */ +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = 0; +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.benchmarking" +int __pyx_module_is_main_lib__Naked__toolshed__c__benchmarking = 0; + +/* Implementation of 'lib.Naked.toolshed.c.benchmarking' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_[] = "()..."; +static char __pyx_k_L[] = "L"; +static char __pyx_k_i[] = "i"; +static char __pyx_k_j[] = "j"; +static char __pyx_k_n[] = "n"; +static char __pyx_k_x[] = "x"; +static char __pyx_k_y[] = "y"; +static char __pyx_k__2[] = " "; +static char __pyx_k__3[] = " : "; +static char __pyx_k_gc[] = "gc"; +static char __pyx_k_ie[] = "ie"; +static char __pyx_k_np[] = "np"; +static char __pyx_k__16[] = "()"; +static char __pyx_k__17[] = "."; +static char __pyx_k__19[] = ":\t"; +static char __pyx_k__20[] = "-"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_run[] = "run"; +static char __pyx_k_sec[] = " sec"; +static char __pyx_k_std[] = "std"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_end2[] = "end2"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mean[] = "mean"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_Ratio[] = "Ratio: "; +static char __pyx_k_Trial[] = "Trial "; +static char __pyx_k_array[] = "array"; +static char __pyx_k_flush[] = "flush"; +static char __pyx_k_numpy[] = "numpy"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_range[] = "range"; +static char __pyx_k_start[] = "start"; +static char __pyx_k_timer[] = "timer"; +static char __pyx_k_wraps[] = "wraps"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_enable[] = "enable"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_start2[] = "start2"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_trials[] = "trials"; +static char __pyx_k_collect[] = "collect"; +static char __pyx_k_disable[] = "disable"; +static char __pyx_k_wrapper[] = "wrapper"; +static char __pyx_k_Mean_for[] = "Mean for "; +static char __pyx_k_Starting[] = "Starting "; +static char __pyx_k_timer_10[] = "timer_10"; +static char __pyx_k_timer_1k[] = "timer_1k"; +static char __pyx_k_timer_1m[] = "timer_1m"; +static char __pyx_k_functools[] = "functools"; +static char __pyx_k_timer_100[] = "timer_100"; +static char __pyx_k_timer_10k[] = "timer_10k"; +static char __pyx_k_ImportError[] = "ImportError"; +static char __pyx_k_repetitions[] = "repetitions"; +static char __pyx_k_result_list[] = "result_list"; +static char __pyx_k_repetitions_2[] = " repetitions: "; +static char __pyx_k_benchmark_list[] = "benchmark_list"; +static char __pyx_k_mean_benchmark[] = "mean_benchmark"; +static char __pyx_k_repetitions_of[] = " repetitions of "; +static char __pyx_k_Standard_Deviation[] = "Standard Deviation: "; +static char __pyx_k_Mean_per_repetition[] = "Mean per repetition: "; +static char __pyx_k_timer_locals_wrapper[] = "timer..wrapper"; +static char __pyx_k_of_benchmark_function[] = " of benchmark function:"; +static char __pyx_k_timer_trials_benchmark[] = "timer_trials_benchmark"; +static char __pyx_k_timer_10_locals_wrapper[] = "timer_10..wrapper"; +static char __pyx_k_timer_1k_locals_wrapper[] = "timer_1k..wrapper"; +static char __pyx_k_timer_1m_locals_wrapper[] = "timer_1m..wrapper"; +static char __pyx_k_Starting_timed_trials_of[] = "Starting timed trials of "; +static char __pyx_k_timer_100_locals_wrapper[] = "timer_100..wrapper"; +static char __pyx_k_timer_10k_locals_wrapper[] = "timer_10k..wrapper"; +static char __pyx_k_timer_trials_benchmark_10[] = "timer_trials_benchmark_10"; +static char __pyx_k_timer_trials_benchmark_1k[] = "timer_trials_benchmark_1k"; +static char __pyx_k_timer_trials_benchmark_1m[] = "timer_trials_benchmark_1m"; +static char __pyx_k_timer_trials_benchmark_100[] = "timer_trials_benchmark_100"; +static char __pyx_k_timer_trials_benchmark_10k[] = "timer_trials_benchmark_10k"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/benchmarking.pyx"; +static char __pyx_k_lib_Naked_toolshed_c_benchmarkin[] = "lib.Naked.toolshed.c.benchmarking"; +static char __pyx_k_timer_trials_benchmark_100_local[] = "timer_trials_benchmark_100..wrapper"; +static char __pyx_k_timer_trials_benchmark_10_locals[] = "timer_trials_benchmark_10..wrapper"; +static char __pyx_k_timer_trials_benchmark_10k_local[] = "timer_trials_benchmark_10k..wrapper"; +static char __pyx_k_timer_trials_benchmark_1k_locals[] = "timer_trials_benchmark_1k..wrapper"; +static char __pyx_k_timer_trials_benchmark_1m_locals[] = "timer_trials_benchmark_1m..wrapper"; +static char __pyx_k_timer_trials_benchmark_locals_wr[] = "timer_trials_benchmark..wrapper"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_n_s_L; +static PyObject *__pyx_kp_s_Mean_for; +static PyObject *__pyx_kp_s_Mean_per_repetition; +static PyObject *__pyx_kp_s_Ratio; +static PyObject *__pyx_kp_s_Standard_Deviation; +static PyObject *__pyx_kp_s_Starting; +static PyObject *__pyx_kp_s_Starting_timed_trials_of; +static PyObject *__pyx_kp_s_Trial; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__16; +static PyObject *__pyx_kp_s__17; +static PyObject *__pyx_kp_s__19; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__20; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_benchmark_list; +static PyObject *__pyx_n_s_collect; +static PyObject *__pyx_n_s_disable; +static PyObject *__pyx_n_s_enable; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_end2; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_flush; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_functools; +static PyObject *__pyx_n_s_gc; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_ie; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_benchmarkin; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mean; +static PyObject *__pyx_n_s_mean_benchmark; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_of_benchmark_function; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_repetitions; +static PyObject *__pyx_kp_s_repetitions_2; +static PyObject *__pyx_kp_s_repetitions_of; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_result_list; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_kp_s_sec; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start2; +static PyObject *__pyx_n_s_std; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_timer_10; +static PyObject *__pyx_n_s_timer_100; +static PyObject *__pyx_n_s_timer_100_locals_wrapper; +static PyObject *__pyx_n_s_timer_10_locals_wrapper; +static PyObject *__pyx_n_s_timer_10k; +static PyObject *__pyx_n_s_timer_10k_locals_wrapper; +static PyObject *__pyx_n_s_timer_1k; +static PyObject *__pyx_n_s_timer_1k_locals_wrapper; +static PyObject *__pyx_n_s_timer_1m; +static PyObject *__pyx_n_s_timer_1m_locals_wrapper; +static PyObject *__pyx_n_s_timer_locals_wrapper; +static PyObject *__pyx_n_s_timer_trials_benchmark; +static PyObject *__pyx_n_s_timer_trials_benchmark_10; +static PyObject *__pyx_n_s_timer_trials_benchmark_100; +static PyObject *__pyx_n_s_timer_trials_benchmark_100_local; +static PyObject *__pyx_n_s_timer_trials_benchmark_10_locals; +static PyObject *__pyx_n_s_timer_trials_benchmark_10k; +static PyObject *__pyx_n_s_timer_trials_benchmark_10k_local; +static PyObject *__pyx_n_s_timer_trials_benchmark_1k; +static PyObject *__pyx_n_s_timer_trials_benchmark_1k_locals; +static PyObject *__pyx_n_s_timer_trials_benchmark_1m; +static PyObject *__pyx_n_s_timer_trials_benchmark_1m_locals; +static PyObject *__pyx_n_s_timer_trials_benchmark_locals_wr; +static PyObject *__pyx_n_s_trials; +static PyObject *__pyx_n_s_wrapper; +static PyObject *__pyx_n_s_wraps; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_y; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_50; +static PyObject *__pyx_int_100; +static PyObject *__pyx_int_1000; +static PyObject *__pyx_int_10000; +static PyObject *__pyx_int_100000; +static PyObject *__pyx_int_1000000; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_tuple__54; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__7; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__45; +static PyObject *__pyx_codeobj__47; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; +static PyObject *__pyx_codeobj__55; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__61; + +/* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_1timer = {__Pyx_NAMESTR("timer"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_100000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":22 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":23 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":24 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":26 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":27 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":28 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":29 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":30 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":31 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":32 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":33 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":34 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":35 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":20 + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper, 0, __pyx_n_s_timer_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":20 + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":36 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10 = {__Pyx_NAMESTR("timer_10"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_10 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_10") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_10", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":46 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":47 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":48 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":50 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":51 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":52 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":53 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":54 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":55 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":56 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":57 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":58 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":59 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_10", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":44 + * + * def timer_10(func, repetitions=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper, 0, __pyx_n_s_timer_10_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":44 + * + * def timer_10(func, repetitions=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":60 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_100(func, repetitions=100): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100 = {__Pyx_NAMESTR("timer_100"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_100 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_100); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_100") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":65 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":66 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":67 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":69 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":70 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":71 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":72 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":73 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":74 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":75 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":76 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":77 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":78 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_100", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":63 + * + * def timer_100(func, repetitions=100): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper, 0, __pyx_n_s_timer_100_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":63 + * + * def timer_100(func, repetitions=100): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":79 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_1k(func, repetitions=1000): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k = {__Pyx_NAMESTR("timer_1k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_1k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_1000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_1k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_1k", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":84 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":85 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":86 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":88 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":89 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":90 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":91 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":92 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":93 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":94 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":95 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":96 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":97 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_1k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":82 + * + * def timer_1k(func, repetitions=1000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper, 0, __pyx_n_s_timer_1k_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":82 + * + * def timer_1k(func, repetitions=1000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":98 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_10k(func, repetitions=10000): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k = {__Pyx_NAMESTR("timer_10k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_10k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_10000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_10k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_10k", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":103 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":104 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":105 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":107 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":108 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":109 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":110 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":111 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":112 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":113 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":114 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":115 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":116 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_10k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":101 + * + * def timer_10k(func, repetitions=10000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper, 0, __pyx_n_s_timer_10k_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":101 + * + * def timer_10k(func, repetitions=10000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":117 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_1m(func, repetitions=1000000): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m = {__Pyx_NAMESTR("timer_1m"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_1m (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_1000000); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_1m") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_1m", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(__pyx_self, __pyx_v_func, __pyx_v_repetitions); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_outer_scope; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":122 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * print(" ") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":123 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * print(" ") + * # disable garbage collection + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":124 + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + * print(" ") # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":126 + * print(" ") + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * start = time.time() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":127 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * start = time.time() + * for x in range(repetitions): + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":128 + * gc.collect() + * gc.disable() + * start = time.time() # <<<<<<<<<<<<<< + * for x in range(repetitions): + * result = func(*args, **kwargs) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_start = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":129 + * gc.disable() + * start = time.time() + * for x in range(repetitions): # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":130 + * start = time.time() + * for x in range(repetitions): + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * gc.enable() # re-enable garbage collection + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3); + __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":131 + * for x in range(repetitions): + * result = func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_end = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":132 + * result = func(*args, **kwargs) + * end = time.time() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":133 + * end = time.time() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":134 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":135 + * gc.collect() + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_1m", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":120 + * + * def timer_1m(func, repetitions=1000000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper, 0, __pyx_n_s_timer_1m_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":120 + * + * def timer_1m(func, repetitions=1000000): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":136 + * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark = {__Pyx_NAMESTR("timer_trials_benchmark"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_100000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":155 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":156 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":157 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":158 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":160 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":161 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":162 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":164 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":165 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":166 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":167 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":168 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":169 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":171 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":172 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":173 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":174 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":175 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":176 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":177 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":178 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":179 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":180 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":181 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":182 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":183 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":184 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":185 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":186 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":187 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":188 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":189 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":190 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":191 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":192 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":193 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":194 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":195 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":197 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":198 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":199 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":200 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":153 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_locals_wr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":153 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":201 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10 = {__Pyx_NAMESTR("timer_trials_benchmark_10"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_10 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_10); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_10") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_10", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":210 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":211 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":212 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":213 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":215 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":216 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":217 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":219 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":220 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":221 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":222 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":223 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":224 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":226 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":227 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":228 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":229 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":230 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":231 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":232 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":233 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":234 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":235 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":236 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":237 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":238 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":239 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":240 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":241 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":242 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":243 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":244 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":245 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":246 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":247 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":248 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":249 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":250 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":252 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":253 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":254 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":255 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_10", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":208 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_10_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":208 + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":256 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100 = {__Pyx_NAMESTR("timer_trials_benchmark_100"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_100 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_100); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_100") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_100", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":261 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":262 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":263 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":264 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":266 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":267 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":268 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":270 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":271 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":272 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":273 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":274 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":275 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":277 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":278 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":279 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":280 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":281 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":282 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":283 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":284 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":285 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":286 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":287 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":288 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":289 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":290 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":291 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":292 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":293 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":294 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":295 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":296 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":297 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":298 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":299 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":300 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":301 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":303 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":304 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":305 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":306 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_100", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":259 + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_100_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":259 + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":307 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k = {__Pyx_NAMESTR("timer_trials_benchmark_1k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_1k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_1000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_1k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_1k", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":312 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":313 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":314 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":315 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":317 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":318 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":319 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":321 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":322 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":323 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":324 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":325 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":326 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":328 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":329 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":330 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":331 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":332 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":333 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":334 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":335 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":336 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":337 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":338 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":339 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":340 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":341 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":342 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":343 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":344 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":345 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":346 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":347 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":348 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":349 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":350 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":351 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":352 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":354 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":355 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":356 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":357 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_1k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":310 + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_1k_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":310 + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":358 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k = {__Pyx_NAMESTR("timer_trials_benchmark_10k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_10k (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_10000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_10k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_10k", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":363 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":364 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":365 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":366 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":368 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":369 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":370 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":372 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":373 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":374 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":375 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":376 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":377 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":379 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":380 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":381 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":382 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":383 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":384 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":385 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":386 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":387 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":388 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":389 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":390 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":391 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":392 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":393 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":394 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":395 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":396 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":397 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":398 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":399 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":400 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":401 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":402 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":403 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":405 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":406 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":407 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":408 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_10k", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":361 + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_10k_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":361 + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":409 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m = {__Pyx_NAMESTR("timer_trials_benchmark_1m"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_repetitions = 0; + PyObject *__pyx_v_trials = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer_trials_benchmark_1m (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)__pyx_int_1000000); + values[2] = ((PyObject *)__pyx_int_10); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_1m") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_repetitions = values[1]; + __pyx_v_trials = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_1m", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_outer_scope; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_benchmark_list = NULL; + CYTHON_UNUSED PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_start = NULL; + CYTHON_UNUSED PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_end = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_L = NULL; + PyObject *__pyx_v_start2 = NULL; + CYTHON_UNUSED PyObject *__pyx_v_j = NULL; + long __pyx_v_i; + PyObject *__pyx_v_end2 = NULL; + PyObject *__pyx_v_n = NULL; + PyObject *__pyx_v_run = NULL; + PyObject *__pyx_v_mean = NULL; + PyObject *__pyx_v_mean_benchmark = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_array = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ie = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + long __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":414 + * @wraps(func) + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * result_list = [] + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":415 + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * result_list = [] + * benchmark_list = [] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":416 + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + * result_list = [] # <<<<<<<<<<<<<< + * benchmark_list = [] + * # disable garbage collection + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":417 + * sys.stdout.flush() + * result_list = [] + * benchmark_list = [] # <<<<<<<<<<<<<< + * # disable garbage collection + * gc.collect() + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":419 + * benchmark_list = [] + * # disable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * gc.disable() + * for x in range(trials): + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":420 + * # disable garbage collection + * gc.collect() + * gc.disable() # <<<<<<<<<<<<<< + * for x in range(trials): + * # test function + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":421 + * gc.collect() + * gc.disable() + * for x in range(trials): # <<<<<<<<<<<<<< + * # test function + * start = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":423 + * for x in range(trials): + * # test function + * start = time.time() # <<<<<<<<<<<<<< + * for y in range(repetitions): + * func(*args, **kwargs) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":424 + * # test function + * start = time.time() + * for y in range(repetitions): # <<<<<<<<<<<<<< + * func(*args, **kwargs) + * end = time.time() + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_1 = __pyx_t_7(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":425 + * start = time.time() + * for y in range(repetitions): + * func(*args, **kwargs) # <<<<<<<<<<<<<< + * end = time.time() + * result = func(*args, **kwargs) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":426 + * for y in range(repetitions): + * func(*args, **kwargs) + * end = time.time() # <<<<<<<<<<<<<< + * result = func(*args, **kwargs) + * result_list.append(end-start) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":427 + * func(*args, **kwargs) + * end = time.time() + * result = func(*args, **kwargs) # <<<<<<<<<<<<<< + * result_list.append(end-start) + * # benchmark function + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":428 + * end = time.time() + * result = func(*args, **kwargs) + * result_list.append(end-start) # <<<<<<<<<<<<<< + * # benchmark function + * L = [] + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":430 + * result_list.append(end-start) + * # benchmark function + * L = [] # <<<<<<<<<<<<<< + * start2 = time.time() + * for j in range(repetitions): + */ + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":431 + * # benchmark function + * L = [] + * start2 = time.time() # <<<<<<<<<<<<<< + * for j in range(repetitions): + * for i in range(10): + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":432 + * L = [] + * start2 = time.time() + * for j in range(repetitions): # <<<<<<<<<<<<<< + * for i in range(10): + * L.append(i) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_7(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9); + __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":433 + * start2 = time.time() + * for j in range(repetitions): + * for i in range(10): # <<<<<<<<<<<<<< + * L.append(i) + * end2 = time.time() + */ + for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":434 + * for j in range(repetitions): + * for i in range(10): + * L.append(i) # <<<<<<<<<<<<<< + * end2 = time.time() + * benchmark_list.append(end2 - start2) + */ + __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":435 + * for i in range(10): + * L.append(i) + * end2 = time.time() # <<<<<<<<<<<<<< + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":436 + * L.append(i) + * end2 = time.time() + * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<< + * sys.stdout.write(".") + * sys.stdout.flush() + */ + __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":437 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":438 + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * gc.enable() # re-enable garbage collection + * gc.collect() + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":439 + * sys.stdout.write(".") + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<< + * gc.collect() + * print(" ") + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":440 + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + * gc.collect() # <<<<<<<<<<<<<< + * print(" ") + * n = 1 + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":441 + * gc.enable() # re-enable garbage collection + * gc.collect() + * print(" ") # <<<<<<<<<<<<<< + * n = 1 + * for run in result_list: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":442 + * gc.collect() + * print(" ") + * n = 1 # <<<<<<<<<<<<<< + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_n = __pyx_int_1; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":443 + * print(" ") + * n = 1 + * for run in result_list: # <<<<<<<<<<<<<< + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + */ + __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + for (;;) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":444 + * n = 1 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<< + * n += 1 + * print("-"*50) + */ + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n); + __Pyx_GIVEREF(__pyx_v_n); + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_run); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run); + __Pyx_GIVEREF(__pyx_v_run); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":445 + * for run in result_list: + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 # <<<<<<<<<<<<<< + * print("-"*50) + * mean = sum(result_list)/len(result_list) + */ + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8); + __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":446 + * print("Trial " + str(n) + ":\t" + str(run)) + * n += 1 + * print("-"*50) # <<<<<<<<<<<<<< + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + */ + __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":447 + * n += 1 + * print("-"*50) + * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<< + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_mean = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":448 + * print("-"*50) + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_benchmark_list); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list); + __Pyx_GIVEREF(__pyx_v_benchmark_list); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mean_benchmark = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":449 + * mean = sum(result_list)/len(result_list) + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<< + * try: + * import numpy as np + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean); + __Pyx_GIVEREF(__pyx_v_mean); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":450 + * mean_benchmark = sum(benchmark_list)/len(benchmark_list) + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: # <<<<<<<<<<<<<< + * import numpy as np + * array = np.array(result_list) + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/benchmarking.pyx":451 + * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + * try: + * import numpy as np # <<<<<<<<<<<<<< + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_np = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":452 + * try: + * import numpy as np + * array = np.array(result_list) # <<<<<<<<<<<<<< + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result_list); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list); + __Pyx_GIVEREF(__pyx_v_result_list); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_array = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":453 + * import numpy as np + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<< + * except ImportError as ie: + * pass + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_array); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array); + __Pyx_GIVEREF(__pyx_v_array); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L20_try_end; + __pyx_L13_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":454 + * array = np.array(result_list) + * print( "Standard Deviation: " + str(np.std(array))) + * except ImportError as ie: # <<<<<<<<<<<<<< + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ie = __pyx_t_3; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; + } + goto __pyx_L15_except_error; + __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L20_try_end:; + } + + /* "lib/Naked/toolshed/c/benchmarking.pyx":456 + * except ImportError as ie: + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<< + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":457 + * pass + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<< + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_mean_benchmark); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark); + __Pyx_GIVEREF(__pyx_v_mean_benchmark); + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":458 + * print("Mean per repetition: " + str(mean/repetitions) + " sec") + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<< + * return result + * return wrapper + */ + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":459 + * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + * print("Ratio: " + str(mean/mean_benchmark)) + * return result # <<<<<<<<<<<<<< + * return wrapper + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_benchmark_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_start); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_end); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_L); + __Pyx_XDECREF(__pyx_v_start2); + __Pyx_XDECREF(__pyx_v_j); + __Pyx_XDECREF(__pyx_v_end2); + __Pyx_XDECREF(__pyx_v_n); + __Pyx_XDECREF(__pyx_v_run); + __Pyx_XDECREF(__pyx_v_mean); + __Pyx_XDECREF(__pyx_v_mean_benchmark); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_array); + __Pyx_XDECREF(__pyx_v_ie); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_cur_scope; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("timer_trials_benchmark_1m", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions); + __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":412 + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_1m_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":412 + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrapper = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":460 + * print("Ratio: " + str(mean/mean_benchmark)) + * return result + * return wrapper # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct__timer"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_1_timer_10"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_2_timer_100"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_3_timer_1k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_4_timer_10k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_5_timer_1m"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_6_timer_trials_benchmark"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_7_timer_trials_benchmark_10"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_8_timer_trials_benchmark_100"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_9_timer_trials_benchmark_1k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_10_timer_trials_benchmark_10k"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + Py_CLEAR(p->__pyx_v_repetitions); + Py_CLEAR(p->__pyx_v_trials); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + if (p->__pyx_v_repetitions) { + e = (*v)(p->__pyx_v_repetitions, a); if (e) return e; + } + if (p->__pyx_v_trials) { + e = (*v)(p->__pyx_v_trials, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_repetitions); + p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_trials); + p->__pyx_v_trials = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_11_timer_trials_benchmark_1m"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("benchmarking"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1}, + {&__pyx_kp_s_Mean_for, __pyx_k_Mean_for, sizeof(__pyx_k_Mean_for), 0, 0, 1, 0}, + {&__pyx_kp_s_Mean_per_repetition, __pyx_k_Mean_per_repetition, sizeof(__pyx_k_Mean_per_repetition), 0, 0, 1, 0}, + {&__pyx_kp_s_Ratio, __pyx_k_Ratio, sizeof(__pyx_k_Ratio), 0, 0, 1, 0}, + {&__pyx_kp_s_Standard_Deviation, __pyx_k_Standard_Deviation, sizeof(__pyx_k_Standard_Deviation), 0, 0, 1, 0}, + {&__pyx_kp_s_Starting, __pyx_k_Starting, sizeof(__pyx_k_Starting), 0, 0, 1, 0}, + {&__pyx_kp_s_Starting_timed_trials_of, __pyx_k_Starting_timed_trials_of, sizeof(__pyx_k_Starting_timed_trials_of), 0, 0, 1, 0}, + {&__pyx_kp_s_Trial, __pyx_k_Trial, sizeof(__pyx_k_Trial), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0}, + {&__pyx_kp_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 0}, + {&__pyx_kp_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_benchmark_list, __pyx_k_benchmark_list, sizeof(__pyx_k_benchmark_list), 0, 0, 1, 1}, + {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1}, + {&__pyx_n_s_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 0, 1, 1}, + {&__pyx_n_s_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_end2, __pyx_k_end2, sizeof(__pyx_k_end2), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_ie, __pyx_k_ie, sizeof(__pyx_k_ie), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_benchmarkin, __pyx_k_lib_Naked_toolshed_c_benchmarkin, sizeof(__pyx_k_lib_Naked_toolshed_c_benchmarkin), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1}, + {&__pyx_n_s_mean_benchmark, __pyx_k_mean_benchmark, sizeof(__pyx_k_mean_benchmark), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_of_benchmark_function, __pyx_k_of_benchmark_function, sizeof(__pyx_k_of_benchmark_function), 0, 0, 1, 0}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_repetitions, __pyx_k_repetitions, sizeof(__pyx_k_repetitions), 0, 0, 1, 1}, + {&__pyx_kp_s_repetitions_2, __pyx_k_repetitions_2, sizeof(__pyx_k_repetitions_2), 0, 0, 1, 0}, + {&__pyx_kp_s_repetitions_of, __pyx_k_repetitions_of, sizeof(__pyx_k_repetitions_of), 0, 0, 1, 0}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_list, __pyx_k_result_list, sizeof(__pyx_k_result_list), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_kp_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start2, __pyx_k_start2, sizeof(__pyx_k_start2), 0, 0, 1, 1}, + {&__pyx_n_s_std, __pyx_k_std, sizeof(__pyx_k_std), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10, __pyx_k_timer_10, sizeof(__pyx_k_timer_10), 0, 0, 1, 1}, + {&__pyx_n_s_timer_100, __pyx_k_timer_100, sizeof(__pyx_k_timer_100), 0, 0, 1, 1}, + {&__pyx_n_s_timer_100_locals_wrapper, __pyx_k_timer_100_locals_wrapper, sizeof(__pyx_k_timer_100_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10_locals_wrapper, __pyx_k_timer_10_locals_wrapper, sizeof(__pyx_k_timer_10_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10k, __pyx_k_timer_10k, sizeof(__pyx_k_timer_10k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_10k_locals_wrapper, __pyx_k_timer_10k_locals_wrapper, sizeof(__pyx_k_timer_10k_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1k, __pyx_k_timer_1k, sizeof(__pyx_k_timer_1k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1k_locals_wrapper, __pyx_k_timer_1k_locals_wrapper, sizeof(__pyx_k_timer_1k_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1m, __pyx_k_timer_1m, sizeof(__pyx_k_timer_1m), 0, 0, 1, 1}, + {&__pyx_n_s_timer_1m_locals_wrapper, __pyx_k_timer_1m_locals_wrapper, sizeof(__pyx_k_timer_1m_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_locals_wrapper, __pyx_k_timer_locals_wrapper, sizeof(__pyx_k_timer_locals_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark, __pyx_k_timer_trials_benchmark, sizeof(__pyx_k_timer_trials_benchmark), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10, __pyx_k_timer_trials_benchmark_10, sizeof(__pyx_k_timer_trials_benchmark_10), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_100, __pyx_k_timer_trials_benchmark_100, sizeof(__pyx_k_timer_trials_benchmark_100), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_100_local, __pyx_k_timer_trials_benchmark_100_local, sizeof(__pyx_k_timer_trials_benchmark_100_local), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10_locals, __pyx_k_timer_trials_benchmark_10_locals, sizeof(__pyx_k_timer_trials_benchmark_10_locals), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10k, __pyx_k_timer_trials_benchmark_10k, sizeof(__pyx_k_timer_trials_benchmark_10k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_10k_local, __pyx_k_timer_trials_benchmark_10k_local, sizeof(__pyx_k_timer_trials_benchmark_10k_local), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1k, __pyx_k_timer_trials_benchmark_1k, sizeof(__pyx_k_timer_trials_benchmark_1k), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1k_locals, __pyx_k_timer_trials_benchmark_1k_locals, sizeof(__pyx_k_timer_trials_benchmark_1k_locals), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1m, __pyx_k_timer_trials_benchmark_1m, sizeof(__pyx_k_timer_trials_benchmark_1m), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_1m_locals, __pyx_k_timer_trials_benchmark_1m_locals, sizeof(__pyx_k_timer_trials_benchmark_1m_locals), 0, 0, 1, 1}, + {&__pyx_n_s_timer_trials_benchmark_locals_wr, __pyx_k_timer_trials_benchmark_locals_wr, sizeof(__pyx_k_timer_trials_benchmark_locals_wr), 0, 0, 1, 1}, + {&__pyx_n_s_trials, __pyx_k_trials, sizeof(__pyx_k_trials), 0, 0, 1, 1}, + {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":21 + * def timer(func, repetitions=100000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":45 + * def timer_10(func, repetitions=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":64 + * def timer_100(func, repetitions=100): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":83 + * def timer_1k(func, repetitions=1000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":102 + * def timer_10k(func, repetitions=10000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":121 + * def timer_1m(func, repetitions=1000000): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + * sys.stdout.flush() + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":178 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":154 + * def timer_trials_benchmark(func, repetitions=100000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__21 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":233 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":209 + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__24 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":284 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":260 + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__27 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":335 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":311 + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__30 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":386 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":362 + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__33 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":437 + * end2 = time.time() + * benchmark_list.append(end2 - start2) + * sys.stdout.write(".") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * gc.enable() # re-enable garbage collection + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "lib/Naked/toolshed/c/benchmarking.pyx":413 + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + * sys.stdout.flush() + */ + __pyx_tuple__36 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_10, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_100, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_1k, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__46 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_10k, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_1m, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_10, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_100, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_1k, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_10k, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_1m, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_100000 = PyInt_FromLong(100000L); if (unlikely(!__pyx_int_100000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initbenchmarking(void); /*proto*/ +PyMODINIT_FUNC initbenchmarking(void) +#else +PyMODINIT_FUNC PyInit_benchmarking(void); /*proto*/ +PyMODINIT_FUNC PyInit_benchmarking(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_benchmarking(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("benchmarking"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__benchmarking) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.benchmarking")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.benchmarking", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/benchmarking.pyx":4 + * # encoding: utf-8 + * + * import sys # <<<<<<<<<<<<<< + * import time + * import gc + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":5 + * + * import sys + * import time # <<<<<<<<<<<<<< + * import gc + * from functools import wraps + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":6 + * import sys + * import time + * import gc # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":7 + * import time + * import gc + * from functools import wraps # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wraps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":19 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer(func, repetitions=100000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_1timer, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":43 + * #------------------------------------------------------------------------------ + * + * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":62 + * return wrapper + * + * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":81 + * return wrapper + * + * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_1k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":100 + * return wrapper + * + * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_10k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":119 + * return wrapper + * + * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_1m, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":152 + * # def myfunction(): + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":207 + * # additional benchmark decorators that replicate the above function with different # repetitions + * #------------------------------------------------------------------------------ + * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":258 + * return wrapper + * + * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":309 + * return wrapper + * + * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_1k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":360 + * return wrapper + * + * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_10k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":411 + * return wrapper + * + * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<< + * @wraps(func) + * def wrapper(*args, **kwargs): + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_1m, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":462 + * return wrapper + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/benchmarking.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.benchmarking", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.benchmarking"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CPYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx new file mode 100644 index 00000000..63878bc0 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/benchmarking.pyx @@ -0,0 +1,463 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import time +import gc +from functools import wraps + +#------------------------------------------------------------------------------ +# [ timer function decorator ] +# runs timed repetitions of the decorated function in a single trial +# default is 100,000 repetitions in the trial +# reports the results of the trial +# Usage example: +# from Naked.toolshed.benchmarking import timer +# @timer +# def myfunction(): +#------------------------------------------------------------------------------ +def timer(func, repetitions=100000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_X function decorators ] +# replicate the above decorator with different number of repetitions +#------------------------------------------------------------------------------ + +def timer_10(func, repetitions=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_100(func, repetitions=100): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1k(func, repetitions=1000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_10k(func, repetitions=10000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +def timer_1m(func, repetitions=1000000): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") + sys.stdout.flush() + print(" ") + # disable garbage collection + gc.collect() + gc.disable() + start = time.time() + for x in range(repetitions): + result = func(*args, **kwargs) + end = time.time() + gc.enable() # re-enable garbage collection + gc.collect() + print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark decorator function ] +# time a function and compare to a benchmark function +# default is 10 trials x 100,000 repetitions/trial for each function +# Results: +# - Mean of the 10 trials of the test function +# - standard deviation of the 10 trials (if numpy is available) +# - result for 100,000 repetitions of the benchmark function +# - ratio of the test : benchmark function results +# Usage example: +# from Naked.toolshed.benchmarking import timer_trials_benchmark +# @timer_trials_benchmark +# def myfunction(): +#------------------------------------------------------------------------------ +def timer_trials_benchmark(func, repetitions=100000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +#------------------------------------------------------------------------------ +# [ timer_trials_benchmark_X decorators ] +# additional benchmark decorators that replicate the above function with different # repetitions +#------------------------------------------------------------------------------ +def timer_trials_benchmark_10(func, repetitions=10, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_100(func, repetitions=100, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): + @wraps(func) + def wrapper(*args, **kwargs): + sys.stdout.write("Starting timed trials of " + func.__name__ + "()") + sys.stdout.flush() + result_list = [] + benchmark_list = [] + # disable garbage collection + gc.collect() + gc.disable() + for x in range(trials): + # test function + start = time.time() + for y in range(repetitions): + func(*args, **kwargs) + end = time.time() + result = func(*args, **kwargs) + result_list.append(end-start) + # benchmark function + L = [] + start2 = time.time() + for j in range(repetitions): + for i in range(10): + L.append(i) + end2 = time.time() + benchmark_list.append(end2 - start2) + sys.stdout.write(".") + sys.stdout.flush() + gc.enable() # re-enable garbage collection + gc.collect() + print(" ") + n = 1 + for run in result_list: + print("Trial " + str(n) + ":\t" + str(run)) + n += 1 + print("-"*50) + mean = sum(result_list)/len(result_list) + mean_benchmark = sum(benchmark_list)/len(benchmark_list) + print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") + try: + import numpy as np + array = np.array(result_list) + print( "Standard Deviation: " + str(np.std(array))) + except ImportError as ie: + pass + print("Mean per repetition: " + str(mean/repetitions) + " sec") + print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") + print("Ratio: " + str(mean/mean_benchmark)) + return result + return wrapper + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/build.sh b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/build.sh new file mode 100644 index 00000000..35154d45 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/build.sh @@ -0,0 +1 @@ +python setup.py build_ext --inplace diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.c new file mode 100644 index 00000000..796941b4 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.c @@ -0,0 +1,5294 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:13 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__casts +#define __PYX_HAVE_API__lib__Naked__toolshed__c__casts +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "casts.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +#ifndef CYTHON_PROFILE + #define CYTHON_PROFILE 1 +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL Py_CLEAR(__pyx_frame) + #endif + #define __Pyx_TraceDeclarations \ + static PyCodeObject *__pyx_frame_code = NULL; \ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ + if (unlikely(PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) { \ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ + } + #define __Pyx_TraceException() \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + PyObject *exc_info = __Pyx_GetExceptionTuple(); \ + if (exc_info) { \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + Py_DECREF(exc_info); \ + } \ + tstate->use_tracing = 1; \ + } + #define __Pyx_TraceReturn(result) \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + if (tstate->c_profilefunc) \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + CYTHON_FRAME_DEL; \ + tstate->use_tracing = 1; \ + } + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result) +#endif /* CYTHON_PROFILE */ +#if CYTHON_TRACE + #define __Pyx_TraceLine(lineno) \ + if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + __pyx_frame->f_lineno = lineno; \ + tstate->use_tracing = 0; \ + tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL); \ + tstate->use_tracing = 1; \ + } +#else + #define __Pyx_TraceLine(lineno) +#endif + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.casts' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.casts" +int __pyx_module_is_main_lib__Naked__toolshed__c__casts = 0; + +/* Implementation of 'lib.Naked.toolshed.c.casts' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_nob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_2xd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_4xl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_6xq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queue_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_8xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_10xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_12xstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_arg, PyObject *__pyx_v_attributes); /* proto */ +static char __pyx_k_2[] = "2"; +static char __pyx_k_e[] = "e"; +static char __pyx_k_te[] = "te"; +static char __pyx_k_xd[] = "xd"; +static char __pyx_k_xl[] = "xl"; +static char __pyx_k_xq[] = "xq"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_nob[] = "nob"; +static char __pyx_k_XSet[] = "XSet"; +static char __pyx_k_arg1[] = "arg1"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_test[] = "test"; +static char __pyx_k_xset[] = "xset"; +static char __pyx_k_xstr[] = "xstr"; +static char __pyx_k_XDict[] = "XDict"; +static char __pyx_k_XFSet[] = "XFSet"; +static char __pyx_k_XList[] = "XList"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_xfset[] = "xfset"; +static char __pyx_k_A_test[] = "A test"; +static char __pyx_k_XQueue[] = "XQueue"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_test_2[] = "__test__"; +static char __pyx_k_XString[] = "XString"; +static char __pyx_k_set_arg[] = "set_arg"; +static char __pyx_k_list_arg[] = "list_arg"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_queue_arg[] = "queue_arg"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_attributes[] = "attributes"; +static char __pyx_k_string_arg[] = "string_arg"; +static char __pyx_k_NakedObject[] = "NakedObject"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_dictionary_arg[] = "dictionary_arg"; +static char __pyx_k_Naked_toolshed_c_types[] = "Naked.toolshed.c.types"; +static char __pyx_k_lib_Naked_toolshed_c_casts[] = "lib.Naked.toolshed.c.casts"; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/casts.pyx"; +static char __pyx_k_Attempted_to_cast_to_a_XDict_wit[] = "Attempted to cast to a XDict with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XList_wit[] = "Attempted to cast to a XList with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XQueue_wi[] = "Attempted to cast to a XQueue with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XSet_with[] = "Attempted to cast to a XSet with an incompatible type"; +static char __pyx_k_Attempted_to_cast_to_a_XString_w[] = "Attempted to cast to a XString with an incompatible type"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py)."; +static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_A_test; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XDict_wit; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XList_wit; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XQueue_wi; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XSet_with; +static PyObject *__pyx_kp_s_Attempted_to_cast_to_a_XString_w; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_NakedObject; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_c_types; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s_XDict; +static PyObject *__pyx_n_s_XFSet; +static PyObject *__pyx_n_s_XList; +static PyObject *__pyx_n_s_XQueue; +static PyObject *__pyx_n_s_XSet; +static PyObject *__pyx_n_s_XString; +static PyObject *__pyx_n_s_arg1; +static PyObject *__pyx_n_s_attributes; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_dictionary_arg; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_casts; +static PyObject *__pyx_n_s_list_arg; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_nob; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_queue_arg; +static PyObject *__pyx_n_s_set_arg; +static PyObject *__pyx_n_s_string_arg; +static PyObject *__pyx_n_s_te; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_2; +static PyObject *__pyx_n_s_xd; +static PyObject *__pyx_n_s_xfset; +static PyObject *__pyx_n_s_xl; +static PyObject *__pyx_n_s_xq; +static PyObject *__pyx_n_s_xset; +static PyObject *__pyx_n_s_xstr; +static PyObject *__pyx_k_; +static PyObject *__pyx_k__2; +static PyObject *__pyx_k__4; +static PyObject *__pyx_k__6; +static PyObject *__pyx_k__8; +static PyObject *__pyx_k__10; +static PyObject *__pyx_k__12; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__19; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; + +/* "lib/Naked/toolshed/c/casts.pyx":5 + * # cython: profile=True + * + * cdef inline int increment(object iterable, object test_string): # <<<<<<<<<<<<<< + * cdef int count = 0 + * cdef object thing + */ + +static CYTHON_INLINE int __pyx_f_3lib_5Naked_8toolshed_1c_5casts_increment(PyObject *__pyx_v_iterable, PyObject *__pyx_v_test_string) { + int __pyx_v_count; + PyObject *__pyx_v_thing = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("increment", 0); + __Pyx_TraceCall("increment", __pyx_f[0], 5); + + /* "lib/Naked/toolshed/c/casts.pyx":6 + * + * cdef inline int increment(object iterable, object test_string): + * cdef int count = 0 # <<<<<<<<<<<<<< + * cdef object thing + * for thing in iterable: + */ + __pyx_v_count = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":8 + * cdef int count = 0 + * cdef object thing + * for thing in iterable: # <<<<<<<<<<<<<< + * if thing == test_string: + * count += 1 + */ + if (PyList_CheckExact(__pyx_v_iterable) || PyTuple_CheckExact(__pyx_v_iterable)) { + __pyx_t_1 = __pyx_v_iterable; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_iterable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_thing, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":9 + * cdef object thing + * for thing in iterable: + * if thing == test_string: # <<<<<<<<<<<<<< + * count += 1 + * return count + */ + __pyx_t_4 = PyObject_RichCompare(__pyx_v_thing, __pyx_v_test_string, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/casts.pyx":10 + * for thing in iterable: + * if thing == test_string: + * count += 1 # <<<<<<<<<<<<<< + * return count + * + */ + __pyx_v_count = (__pyx_v_count + 1); + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":11 + * if thing == test_string: + * count += 1 + * return count # <<<<<<<<<<<<<< + * + * from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString + */ + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/casts.pyx":5 + * # cython: profile=True + * + * cdef inline int increment(object iterable, object test_string): # <<<<<<<<<<<<<< + * cdef int count = 0 + * cdef object thing + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("lib.Naked.toolshed.c.casts.increment", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_thing); + __Pyx_TraceReturn(Py_None); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_1nob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_1nob = {__Pyx_NAMESTR("nob"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_1nob, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_1nob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("nob (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_attributes,0}; + PyObject* values[1] = {0}; + values[0] = __pyx_k_; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nob") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_attributes = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("nob", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.nob", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_nob(__pyx_self, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_nob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("nob", 0); + __Pyx_TraceCall("nob", __pyx_f[0], 20); + + /* "lib/Naked/toolshed/c/casts.pyx":21 + * #------------------------------------------------------------------------------ + * def nob(attributes={}): + * try: # <<<<<<<<<<<<<< + * return NakedObject(attributes) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":22 + * def nob(attributes={}): + * try: + * return NakedObject(attributes) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":23 + * try: + * return NakedObject(attributes) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.nob", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":24 + * return NakedObject(attributes) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":25 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/casts.pyx":26 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.nob", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_3xd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_3xd = {__Pyx_NAMESTR("xd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_3xd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_3xd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dictionary_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dictionary_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__2; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dictionary_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dictionary_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_2xd(__pyx_self, __pyx_v_dictionary_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_2xd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xd", 0); + __Pyx_TraceCall("xd", __pyx_f[0], 32); + + /* "lib/Naked/toolshed/c/casts.pyx":33 + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XDict(dictionary_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":34 + * def xd(dictionary_arg, attributes={}): + * try: + * return XDict(dictionary_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XDict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dictionary_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dictionary_arg); + __Pyx_GIVEREF(__pyx_v_dictionary_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":35 + * try: + * return XDict(dictionary_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":36 + * return XDict(dictionary_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":37 + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":38 + * raise TypeError("Attempted to cast to a XDict with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":39 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":40 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_5xl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_5xl = {__Pyx_NAMESTR("xl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_5xl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_5xl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_list_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xl (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_list_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__4; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_list_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xl", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_4xl(__pyx_self, __pyx_v_list_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_4xl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_list_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xl", 0); + __Pyx_TraceCall("xl", __pyx_f[0], 46); + + /* "lib/Naked/toolshed/c/casts.pyx":47 + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XList(list_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":48 + * def xl(list_arg, attributes={}): + * try: + * return XList(list_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_list_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_list_arg); + __Pyx_GIVEREF(__pyx_v_list_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":49 + * try: + * return XList(list_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XList with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":50 + * return XList(list_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":51 + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":52 + * raise TypeError("Attempted to cast to a XList with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":53 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":54 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_7xq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_7xq = {__Pyx_NAMESTR("xq"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_7xq, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_7xq(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_queue_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xq (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queue_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__6; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_queue_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xq") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_queue_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xq", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_6xq(__pyx_self, __pyx_v_queue_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_6xq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queue_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xq", 0); + __Pyx_TraceCall("xq", __pyx_f[0], 60); + + /* "lib/Naked/toolshed/c/casts.pyx":61 + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XQueue(queue_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":62 + * def xq(queue_arg, attributes={}): + * try: + * return XQueue(queue_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XQueue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_queue_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_queue_arg); + __Pyx_GIVEREF(__pyx_v_queue_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":63 + * try: + * return XQueue(queue_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":64 + * return XQueue(queue_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":65 + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":66 + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":67 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":68 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xq", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_9xset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_9xset = {__Pyx_NAMESTR("xset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_9xset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_9xset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_set_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_set_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__8; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_set_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xset", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_8xset(__pyx_self, __pyx_v_set_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_8xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xset", 0); + __Pyx_TraceCall("xset", __pyx_f[0], 74); + + /* "lib/Naked/toolshed/c/casts.pyx":75 + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XSet(set_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":76 + * def xset(set_arg, attributes={}): + * try: + * return XSet(set_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSet); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_set_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_set_arg); + __Pyx_GIVEREF(__pyx_v_set_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":77 + * try: + * return XSet(set_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":78 + * return XSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":79 + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":80 + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":81 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":82 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_11xfset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_11xfset = {__Pyx_NAMESTR("xfset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_11xfset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_11xfset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_set_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xfset (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_set_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__10; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xfset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_set_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xfset", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_10xfset(__pyx_self, __pyx_v_set_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_10xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_set_arg, PyObject *__pyx_v_attributes) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xfset", 0); + __Pyx_TraceCall("xfset", __pyx_f[0], 88); + + /* "lib/Naked/toolshed/c/casts.pyx":89 + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XFSet(set_arg, attributes) + * except TypeError: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":90 + * def xfset(set_arg, attributes={}): + * try: + * return XFSet(set_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XFSet); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_set_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_set_arg); + __Pyx_GIVEREF(__pyx_v_set_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":91 + * try: + * return XFSet(set_arg, attributes) + * except TypeError: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/casts.pyx":92 + * return XFSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":93 + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":94 + * raise TypeError("Attempted to cast to a XSet with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":95 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":96 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_13xstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_13xstr = {__Pyx_NAMESTR("xstr"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_13xstr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5casts_13xstr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_string_arg = 0; + PyObject *__pyx_v_attributes = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xstr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string_arg,&__pyx_n_s_attributes,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__12; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_arg)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xstr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_string_arg = values[0]; + __pyx_v_attributes = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xstr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5casts_12xstr(__pyx_self, __pyx_v_string_arg, __pyx_v_attributes); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5casts_12xstr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_arg, PyObject *__pyx_v_attributes) { + CYTHON_UNUSED PyObject *__pyx_v_te = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("xstr", 0); + __Pyx_TraceCall("xstr", __pyx_f[0], 102); + + /* "lib/Naked/toolshed/c/casts.pyx":103 + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): + * try: # <<<<<<<<<<<<<< + * return XString(string_arg, attributes) + * except TypeError as te: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/casts.pyx":104 + * def xstr(string_arg, attributes={}): + * try: + * return XString(string_arg, attributes) # <<<<<<<<<<<<<< + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_XString); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_string_arg); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_string_arg); + __Pyx_GIVEREF(__pyx_v_string_arg); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":105 + * try: + * return XString(string_arg, attributes) + * except TypeError as te: # <<<<<<<<<<<<<< + * raise TypeError("Attempted to cast to a XString with an incompatible type") + * except Exception as e: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_te = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":106 + * return XString(string_arg, attributes) + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/casts.pyx":107 + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/casts.pyx":108 + * raise TypeError("Attempted to cast to a XString with an incompatible type") + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/casts.pyx":109 + * except Exception as e: + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Naked_Framework_Error_unable_to_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/casts.pyx":110 + * if DEBUG_FLAG: + * print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + * raise e # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.casts.xstr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_te); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("casts"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_A_test, __pyx_k_A_test, sizeof(__pyx_k_A_test), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XDict_wit, __pyx_k_Attempted_to_cast_to_a_XDict_wit, sizeof(__pyx_k_Attempted_to_cast_to_a_XDict_wit), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XList_wit, __pyx_k_Attempted_to_cast_to_a_XList_wit, sizeof(__pyx_k_Attempted_to_cast_to_a_XList_wit), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XQueue_wi, __pyx_k_Attempted_to_cast_to_a_XQueue_wi, sizeof(__pyx_k_Attempted_to_cast_to_a_XQueue_wi), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XSet_with, __pyx_k_Attempted_to_cast_to_a_XSet_with, sizeof(__pyx_k_Attempted_to_cast_to_a_XSet_with), 0, 0, 1, 0}, + {&__pyx_kp_s_Attempted_to_cast_to_a_XString_w, __pyx_k_Attempted_to_cast_to_a_XString_w, sizeof(__pyx_k_Attempted_to_cast_to_a_XString_w), 0, 0, 1, 0}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_c_types, __pyx_k_Naked_toolshed_c_types, sizeof(__pyx_k_Naked_toolshed_c_types), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s_XDict, __pyx_k_XDict, sizeof(__pyx_k_XDict), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet, __pyx_k_XFSet, sizeof(__pyx_k_XFSet), 0, 0, 1, 1}, + {&__pyx_n_s_XList, __pyx_k_XList, sizeof(__pyx_k_XList), 0, 0, 1, 1}, + {&__pyx_n_s_XQueue, __pyx_k_XQueue, sizeof(__pyx_k_XQueue), 0, 0, 1, 1}, + {&__pyx_n_s_XSet, __pyx_k_XSet, sizeof(__pyx_k_XSet), 0, 0, 1, 1}, + {&__pyx_n_s_XString, __pyx_k_XString, sizeof(__pyx_k_XString), 0, 0, 1, 1}, + {&__pyx_n_s_arg1, __pyx_k_arg1, sizeof(__pyx_k_arg1), 0, 0, 1, 1}, + {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_dictionary_arg, __pyx_k_dictionary_arg, sizeof(__pyx_k_dictionary_arg), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_casts, __pyx_k_lib_Naked_toolshed_c_casts, sizeof(__pyx_k_lib_Naked_toolshed_c_casts), 0, 0, 1, 1}, + {&__pyx_n_s_list_arg, __pyx_k_list_arg, sizeof(__pyx_k_list_arg), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_nob, __pyx_k_nob, sizeof(__pyx_k_nob), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_queue_arg, __pyx_k_queue_arg, sizeof(__pyx_k_queue_arg), 0, 0, 1, 1}, + {&__pyx_n_s_set_arg, __pyx_k_set_arg, sizeof(__pyx_k_set_arg), 0, 0, 1, 1}, + {&__pyx_n_s_string_arg, __pyx_k_string_arg, sizeof(__pyx_k_string_arg), 0, 0, 1, 1}, + {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1}, + {&__pyx_n_s_xd, __pyx_k_xd, sizeof(__pyx_k_xd), 0, 0, 1, 1}, + {&__pyx_n_s_xfset, __pyx_k_xfset, sizeof(__pyx_k_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_xl, __pyx_k_xl, sizeof(__pyx_k_xl), 0, 0, 1, 1}, + {&__pyx_n_s_xq, __pyx_k_xq, sizeof(__pyx_k_xq), 0, 0, 1, 1}, + {&__pyx_n_s_xset, __pyx_k_xset, sizeof(__pyx_k_xset), 0, 0, 1, 1}, + {&__pyx_n_s_xstr, __pyx_k_xstr, sizeof(__pyx_k_xstr), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/casts.pyx":36 + * return XDict(dictionary_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XDict with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XDict_wit); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/casts.pyx":50 + * return XList(list_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XList with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XList_wit); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/casts.pyx":64 + * return XQueue(queue_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XQueue with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XQueue_wi); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/casts.pyx":78 + * return XSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XSet_with); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/casts.pyx":92 + * return XFSet(set_arg, attributes) + * except TypeError: + * raise TypeError("Attempted to cast to a XSet with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XSet_with); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/casts.pyx":106 + * return XString(string_arg, attributes) + * except TypeError as te: + * raise TypeError("Attempted to cast to a XString with an incompatible type") # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Attempted_to_cast_to_a_XString_w); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_nob, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_dictionary_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xd, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + __pyx_tuple__18 = PyTuple_Pack(3, __pyx_n_s_list_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xl, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_queue_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xq, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_set_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xset, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_set_arg, __pyx_n_s_attributes, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xfset, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_string_arg, __pyx_n_s_attributes, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xstr, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcasts(void); /*proto*/ +PyMODINIT_FUNC initcasts(void) +#else +PyMODINIT_FUNC PyInit_casts(void); /*proto*/ +PyMODINIT_FUNC PyInit_casts(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_casts(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("casts"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__casts) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.casts")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.casts", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/casts.pyx":13 + * return count + * + * from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NakedObject); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NakedObject); + __Pyx_GIVEREF(__pyx_n_s_NakedObject); + __Pyx_INCREF(__pyx_n_s_XFSet); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_XFSet); + __Pyx_GIVEREF(__pyx_n_s_XFSet); + __Pyx_INCREF(__pyx_n_s_XDict); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_XDict); + __Pyx_GIVEREF(__pyx_n_s_XDict); + __Pyx_INCREF(__pyx_n_s_XList); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_XList); + __Pyx_GIVEREF(__pyx_n_s_XList); + __Pyx_INCREF(__pyx_n_s_XQueue); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_XQueue); + __Pyx_GIVEREF(__pyx_n_s_XQueue); + __Pyx_INCREF(__pyx_n_s_XSet); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_XSet); + __Pyx_GIVEREF(__pyx_n_s_XSet); + __Pyx_INCREF(__pyx_n_s_XString); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_XString); + __Pyx_GIVEREF(__pyx_n_s_XString); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_c_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NakedObject, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XFSet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XFSet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XDict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XList, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XQueue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XQueue, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XSet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_XString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XString, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":14 + * + * from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":20 + * # Cast a dictionary of attributes to a NakedObject with key>attribute mapping + * #------------------------------------------------------------------------------ + * def nob(attributes={}): # <<<<<<<<<<<<<< + * try: + * return NakedObject(attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k_ = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_1nob, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_nob, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":32 + * # Cast a Python dictionary to a XDict + * #------------------------------------------------------------------------------ + * def xd(dictionary_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XDict(dictionary_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_3xd, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":46 + * # Cast a Python list, set, or tuple to a XList + * #------------------------------------------------------------------------------ + * def xl(list_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XList(list_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__4 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_5xl, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":60 + * # Cast a Python list, set, tuple to a XQueue + * #------------------------------------------------------------------------------ + * def xq(queue_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XQueue(queue_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_7xq, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":74 + * # Cast a Python set to a XSet + * #------------------------------------------------------------------------------ + * def xset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XSet(set_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__8 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_9xset, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":88 + * # Cast a Python set to a XFSet + * #------------------------------------------------------------------------------ + * def xfset(set_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XFSet(set_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__10 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_11xfset, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xfset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":102 + * # Cast a Python string to a XString + * #------------------------------------------------------------------------------ + * def xstr(string_arg, attributes={}): # <<<<<<<<<<<<<< + * try: + * return XString(string_arg, attributes) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__12 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5casts_13xstr, NULL, __pyx_n_s_lib_Naked_toolshed_c_casts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_xstr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":112 + * raise e + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * test = xstr("A test", {'arg1': '2'}) + * print(test) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/casts.pyx":113 + * + * if __name__ == '__main__': + * test = xstr("A test", {'arg1': '2'}) # <<<<<<<<<<<<<< + * print(test) + * print(test[0]) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_xstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arg1, __pyx_kp_s_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_A_test); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_A_test); + __Pyx_GIVEREF(__pyx_kp_s_A_test); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":114 + * if __name__ == '__main__': + * test = xstr("A test", {'arg1': '2'}) + * print(test) # <<<<<<<<<<<<<< + * print(test[0]) + * print(test.arg1) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":115 + * test = xstr("A test", {'arg1': '2'}) + * print(test) + * print(test[0]) # <<<<<<<<<<<<<< + * print(test.arg1) + * print(type(test)) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PrintOne(0, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":116 + * print(test) + * print(test[0]) + * print(test.arg1) # <<<<<<<<<<<<<< + * print(type(test)) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arg1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/casts.pyx":117 + * print(test[0]) + * print(test.arg1) + * print(type(test)) # <<<<<<<<<<<<<< + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PrintOne(0, ((PyObject *)Py_TYPE(__pyx_t_2))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/casts.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=True + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.casts", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.casts"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + const char *funcname, + const char *srcfile, + int firstlineno) { + int retval; + PyThreadState* tstate = PyThreadState_GET(); + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + (*frame)->f_lineno = firstlineno; + tstate->use_tracing = 0; + #if CYTHON_TRACE + if (tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL); + if (!tstate->c_profilefunc) + retval = 1; + else + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + tstate->use_tracing = (tstate->c_profilefunc || + (CYTHON_TRACE && tstate->c_tracefunc)); + return tstate->use_tracing && retval; +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + PyCodeObject *py_code = 0; + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + py_srcfile = PyString_FromString(srcfile); + #else + py_funcname = PyUnicode_FromString(funcname); + py_srcfile = PyUnicode_FromString(srcfile); + #endif + if (!py_funcname | !py_srcfile) goto bad; + py_code = PyCode_New( + 0, /*int argcount,*/ + #if PY_MAJOR_VERSION >= 3 + 0, /*int kwonlyargcount,*/ + #endif + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return py_code; +} +#endif /* CYTHON_PROFILE */ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.pyx new file mode 100644 index 00000000..9b532461 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/casts.pyx @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=True + +cdef inline int increment(object iterable, object test_string): + cdef int count = 0 + cdef object thing + for thing in iterable: + if thing == test_string: + count += 1 + return count + +from Naked.toolshed.c.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ nob ] (NakedObject) +# Cast a dictionary of attributes to a NakedObject with key>attribute mapping +#------------------------------------------------------------------------------ +def nob(attributes={}): + try: + return NakedObject(attributes) + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xd function ] (XDict) +# Cast a Python dictionary to a XDict +#------------------------------------------------------------------------------ +def xd(dictionary_arg, attributes={}): + try: + return XDict(dictionary_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XDict with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xl function ] (XList) +# Cast a Python list, set, or tuple to a XList +#------------------------------------------------------------------------------ +def xl(list_arg, attributes={}): + try: + return XList(list_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XList with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xq function ] (XQueue) +# Cast a Python list, set, tuple to a XQueue +#------------------------------------------------------------------------------ +def xq(queue_arg, attributes={}): + try: + return XQueue(queue_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XQueue with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xset function ] (XSet) +# Cast a Python set to a XSet +#------------------------------------------------------------------------------ +def xset(set_arg, attributes={}): + try: + return XSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xfset function ] (XFSet) +# Cast a Python set to a XFSet +#------------------------------------------------------------------------------ +def xfset(set_arg, attributes={}): + try: + return XFSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xstr function ] (XString) +# Cast a Python string to a XString +#------------------------------------------------------------------------------ +def xstr(string_arg, attributes={}): + try: + return XString(string_arg, attributes) + except TypeError as te: + raise TypeError("Attempted to cast to a XString with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + raise e + +if __name__ == '__main__': + test = xstr("A test", {'arg1': '2'}) + print(test) + print(test[0]) + print(test.arg1) + print(type(test)) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.c new file mode 100644 index 00000000..249536fa --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.c @@ -0,0 +1,3202 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__cstate +#define __PYX_HAVE_API__lib__Naked__toolshed__c__cstate +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "cstate.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.cstate' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.cstate" +int __pyx_module_is_main_lib__Naked__toolshed__c__cstate = 0; + +/* Implementation of 'lib.Naked.toolshed.c.cstate' */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6cstate_11StateObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_[] = "~"; +static char __pyx_k__3[] = "*"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_py[] = "py"; +static char __pyx_k_cwd[] = "cwd"; +static char __pyx_k_day[] = "day"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_now[] = "now"; +static char __pyx_k_py2[] = "py2"; +static char __pyx_k_py3[] = "py3"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_hour[] = "hour"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_path[] = "path"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_year[] = "year"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_month[] = "month"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_py2[] = "is_py2"; +static char __pyx_k_is_py3[] = "is_py3"; +static char __pyx_k_minute[] = "minute"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_pardir[] = "pardir"; +static char __pyx_k_second[] = "second"; +static char __pyx_k_defpath[] = "defpath"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_datetime[] = "datetime"; +static char __pyx_k_platform[] = "platform"; +static char __pyx_k_py_major[] = "py_major"; +static char __pyx_k_py_minor[] = "py_minor"; +static char __pyx_k_py_patch[] = "py_patch"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_user_path[] = "user_path"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_expanduser[] = "expanduser"; +static char __pyx_k_parent_dir[] = "parent_dir"; +static char __pyx_k_StateObject[] = "StateObject"; +static char __pyx_k_default_path[] = "default_path"; +static char __pyx_k_file_encoding[] = "file_encoding"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_string_encoding[] = "string_encoding"; +static char __pyx_k_py_major_version[] = "py_major_version"; +static char __pyx_k_py_minor_version[] = "py_minor_version"; +static char __pyx_k_py_patch_version[] = "py_patch_version"; +static char __pyx_k_StateObject___init[] = "StateObject.__init__"; +static char __pyx_k_getdefaultencoding[] = "getdefaultencoding"; +static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; +static char __pyx_k_Naked_toolshed_c_python[] = "Naked.toolshed.c.python"; +static char __pyx_k_Naked_toolshed_c_system[] = "Naked.toolshed.c.system"; +static char __pyx_k_lib_Naked_toolshed_c_cstate[] = "lib.Naked.toolshed.c.cstate"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/cstate.pyx"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_c_python; +static PyObject *__pyx_n_s_Naked_toolshed_c_system; +static PyObject *__pyx_n_s_StateObject; +static PyObject *__pyx_n_s_StateObject___init; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s__3; +static PyObject *__pyx_n_s_cwd; +static PyObject *__pyx_n_s_datetime; +static PyObject *__pyx_n_s_day; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_default_path; +static PyObject *__pyx_n_s_defpath; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_expanduser; +static PyObject *__pyx_n_s_file_encoding; +static PyObject *__pyx_n_s_getdefaultencoding; +static PyObject *__pyx_n_s_getfilesystemencoding; +static PyObject *__pyx_n_s_hour; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_is_py2; +static PyObject *__pyx_n_s_is_py3; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_cstate; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_minute; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_month; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_pardir; +static PyObject *__pyx_n_s_parent_dir; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_platform; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_py; +static PyObject *__pyx_n_s_py2; +static PyObject *__pyx_n_s_py3; +static PyObject *__pyx_n_s_py_major; +static PyObject *__pyx_n_s_py_major_version; +static PyObject *__pyx_n_s_py_minor; +static PyObject *__pyx_n_s_py_minor_version; +static PyObject *__pyx_n_s_py_patch; +static PyObject *__pyx_n_s_py_patch_version; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_second; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_string_encoding; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_user_path; +static PyObject *__pyx_n_s_year; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_codeobj__5; + +/* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6cstate_11StateObject___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6cstate_11StateObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_now = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/cstate.pyx":14 + * class StateObject: + * def __init__(self): + * now = datetime.datetime.now() # <<<<<<<<<<<<<< + * self.py2 = py.is_py2() #truth test Python 2 interpreter + * self.py3 = py.is_py3() #truth test Python 3 interpreter + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_now = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":15 + * def __init__(self): + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter # <<<<<<<<<<<<<< + * self.py3 = py.is_py3() #truth test Python 3 interpreter + * self.py_major = py.py_major_version() #Python major version + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_py2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":16 + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + * self.py3 = py.is_py3() #truth test Python 3 interpreter # <<<<<<<<<<<<<< + * self.py_major = py.py_major_version() #Python major version + * self.py_minor = py.py_minor_version() #Python minor version + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_py3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":17 + * self.py2 = py.is_py2() #truth test Python 2 interpreter + * self.py3 = py.is_py3() #truth test Python 3 interpreter + * self.py_major = py.py_major_version() #Python major version # <<<<<<<<<<<<<< + * self.py_minor = py.py_minor_version() #Python minor version + * self.py_patch = py.py_patch_version() #Python patch version + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_py_major_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py_major, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":18 + * self.py3 = py.is_py3() #truth test Python 3 interpreter + * self.py_major = py.py_major_version() #Python major version + * self.py_minor = py.py_minor_version() #Python minor version # <<<<<<<<<<<<<< + * self.py_patch = py.py_patch_version() #Python patch version + * self.os = sys.platform #user operating system + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_py_minor_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py_minor, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":19 + * self.py_major = py.py_major_version() #Python major version + * self.py_minor = py.py_minor_version() #Python minor version + * self.py_patch = py.py_patch_version() #Python patch version # <<<<<<<<<<<<<< + * self.os = sys.platform #user operating system + * self.cwd = cwd() #current (present) working directory + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_py); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_py_patch_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_py_patch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":20 + * self.py_minor = py.py_minor_version() #Python minor version + * self.py_patch = py.py_patch_version() #Python patch version + * self.os = sys.platform #user operating system # <<<<<<<<<<<<<< + * self.cwd = cwd() #current (present) working directory + * self.parent_dir = os.pardir + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_platform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":21 + * self.py_patch = py.py_patch_version() #Python patch version + * self.os = sys.platform #user operating system + * self.cwd = cwd() #current (present) working directory # <<<<<<<<<<<<<< + * self.parent_dir = os.pardir + * self.default_path = os.defpath + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_cwd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":22 + * self.os = sys.platform #user operating system + * self.cwd = cwd() #current (present) working directory + * self.parent_dir = os.pardir # <<<<<<<<<<<<<< + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pardir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent_dir, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":23 + * self.cwd = cwd() #current (present) working directory + * self.parent_dir = os.pardir + * self.default_path = os.defpath # <<<<<<<<<<<<<< + * self.user_path = os.path.expanduser("~") + * self.string_encoding = sys.getdefaultencoding() + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_defpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_default_path, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":24 + * self.parent_dir = os.pardir + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") # <<<<<<<<<<<<<< + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_expanduser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_user_path, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":25 + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") + * self.string_encoding = sys.getdefaultencoding() # <<<<<<<<<<<<<< + * self.file_encoding = sys.getfilesystemencoding() + * self.hour = now.hour + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_string_encoding, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":26 + * self.user_path = os.path.expanduser("~") + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() # <<<<<<<<<<<<<< + * self.hour = now.hour + * self.min = now.minute + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_encoding, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":27 + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() + * self.hour = now.hour # <<<<<<<<<<<<<< + * self.min = now.minute + * self.year = now.year + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hour, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":28 + * self.file_encoding = sys.getfilesystemencoding() + * self.hour = now.hour + * self.min = now.minute # <<<<<<<<<<<<<< + * self.year = now.year + * self.day = now.day + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_min, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":29 + * self.hour = now.hour + * self.min = now.minute + * self.year = now.year # <<<<<<<<<<<<<< + * self.day = now.day + * self.month = now.month + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_year, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":30 + * self.min = now.minute + * self.year = now.year + * self.day = now.day # <<<<<<<<<<<<<< + * self.month = now.month + * self.second = now.second + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_day, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":31 + * self.year = now.year + * self.day = now.day + * self.month = now.month # <<<<<<<<<<<<<< + * self.second = now.second + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_month, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":32 + * self.day = now.day + * self.month = now.month + * self.second = now.second # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_second, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.cstate.StateObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_now); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("cstate"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_c_python, __pyx_k_Naked_toolshed_c_python, sizeof(__pyx_k_Naked_toolshed_c_python), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_c_system, __pyx_k_Naked_toolshed_c_system, sizeof(__pyx_k_Naked_toolshed_c_system), 0, 0, 1, 1}, + {&__pyx_n_s_StateObject, __pyx_k_StateObject, sizeof(__pyx_k_StateObject), 0, 0, 1, 1}, + {&__pyx_n_s_StateObject___init, __pyx_k_StateObject___init, sizeof(__pyx_k_StateObject___init), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, + {&__pyx_n_s_cwd, __pyx_k_cwd, sizeof(__pyx_k_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1}, + {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_default_path, __pyx_k_default_path, sizeof(__pyx_k_default_path), 0, 0, 1, 1}, + {&__pyx_n_s_defpath, __pyx_k_defpath, sizeof(__pyx_k_defpath), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_expanduser, __pyx_k_expanduser, sizeof(__pyx_k_expanduser), 0, 0, 1, 1}, + {&__pyx_n_s_file_encoding, __pyx_k_file_encoding, sizeof(__pyx_k_file_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_is_py2, __pyx_k_is_py2, sizeof(__pyx_k_is_py2), 0, 0, 1, 1}, + {&__pyx_n_s_is_py3, __pyx_k_is_py3, sizeof(__pyx_k_is_py3), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_cstate, __pyx_k_lib_Naked_toolshed_c_cstate, sizeof(__pyx_k_lib_Naked_toolshed_c_cstate), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_pardir, __pyx_k_pardir, sizeof(__pyx_k_pardir), 0, 0, 1, 1}, + {&__pyx_n_s_parent_dir, __pyx_k_parent_dir, sizeof(__pyx_k_parent_dir), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 0, 1, 1}, + {&__pyx_n_s_py2, __pyx_k_py2, sizeof(__pyx_k_py2), 0, 0, 1, 1}, + {&__pyx_n_s_py3, __pyx_k_py3, sizeof(__pyx_k_py3), 0, 0, 1, 1}, + {&__pyx_n_s_py_major, __pyx_k_py_major, sizeof(__pyx_k_py_major), 0, 0, 1, 1}, + {&__pyx_n_s_py_major_version, __pyx_k_py_major_version, sizeof(__pyx_k_py_major_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_minor, __pyx_k_py_minor, sizeof(__pyx_k_py_minor), 0, 0, 1, 1}, + {&__pyx_n_s_py_minor_version, __pyx_k_py_minor_version, sizeof(__pyx_k_py_minor_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_patch, __pyx_k_py_patch, sizeof(__pyx_k_py_patch), 0, 0, 1, 1}, + {&__pyx_n_s_py_patch_version, __pyx_k_py_patch_version, sizeof(__pyx_k_py_patch_version), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_string_encoding, __pyx_k_string_encoding, sizeof(__pyx_k_string_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_user_path, __pyx_k_user_path, sizeof(__pyx_k_user_path), 0, 0, 1, 1}, + {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/cstate.pyx":24 + * self.parent_dir = os.pardir + * self.default_path = os.defpath + * self.user_path = os.path.expanduser("~") # <<<<<<<<<<<<<< + * self.string_encoding = sys.getdefaultencoding() + * self.file_encoding = sys.getfilesystemencoding() + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_now); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcstate(void); /*proto*/ +PyMODINIT_FUNC initcstate(void) +#else +PyMODINIT_FUNC PyInit_cstate(void); /*proto*/ +PyMODINIT_FUNC PyInit_cstate(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cstate(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cstate"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__cstate) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.cstate")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.cstate", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/cstate.pyx":5 + * # cython: profile=False + * + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * from Naked.toolshed.c.system import cwd + * import Naked.toolshed.c.python as py + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":6 + * + * from Naked.settings import debug as DEBUG_FLAG + * from Naked.toolshed.c.system import cwd # <<<<<<<<<<<<<< + * import Naked.toolshed.c.python as py + * import sys + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_cwd); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_cwd); + __Pyx_GIVEREF(__pyx_n_s_cwd); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_Naked_toolshed_c_system, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_cwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":7 + * from Naked.settings import debug as DEBUG_FLAG + * from Naked.toolshed.c.system import cwd + * import Naked.toolshed.c.python as py # <<<<<<<<<<<<<< + * import sys + * import os + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s__3); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__3); + __Pyx_GIVEREF(__pyx_n_s__3); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_c_python, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":8 + * from Naked.toolshed.c.system import cwd + * import Naked.toolshed.c.python as py + * import sys # <<<<<<<<<<<<<< + * import os + * import datetime + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":9 + * import Naked.toolshed.c.python as py + * import sys + * import os # <<<<<<<<<<<<<< + * import datetime + * + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":10 + * import sys + * import os + * import datetime # <<<<<<<<<<<<<< + * + * class StateObject: + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":12 + * import datetime + * + * class StateObject: # <<<<<<<<<<<<<< + * def __init__(self): + * now = datetime.datetime.now() + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_StateObject, __pyx_n_s_StateObject, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_cstate, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/cstate.pyx":13 + * + * class StateObject: + * def __init__(self): # <<<<<<<<<<<<<< + * now = datetime.datetime.now() + * self.py2 = py.is_py2() #truth test Python 2 interpreter + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6cstate_11StateObject_1__init__, 0, __pyx_n_s_StateObject___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_cstate, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":12 + * import datetime + * + * class StateObject: # <<<<<<<<<<<<<< + * def __init__(self): + * now = datetime.datetime.now() + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_StateObject, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_StateObject, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/cstate.pyx":34 + * self.second = now.second + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/cstate.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.cstate", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.cstate"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.pyx new file mode 100644 index 00000000..64930186 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cstate.pyx @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +from Naked.settings import debug as DEBUG_FLAG +from Naked.toolshed.c.system import cwd +import Naked.toolshed.c.python as py +import sys +import os +import datetime + +class StateObject: + def __init__(self): + now = datetime.datetime.now() + self.py2 = py.is_py2() #truth test Python 2 interpreter + self.py3 = py.is_py3() #truth test Python 3 interpreter + self.py_major = py.py_major_version() #Python major version + self.py_minor = py.py_minor_version() #Python minor version + self.py_patch = py.py_patch_version() #Python patch version + self.os = sys.platform #user operating system + self.cwd = cwd() #current (present) working directory + self.parent_dir = os.pardir + self.default_path = os.defpath + self.user_path = os.path.expanduser("~") + self.string_encoding = sys.getdefaultencoding() + self.file_encoding = sys.getfilesystemencoding() + self.hour = now.hour + self.min = now.minute + self.year = now.year + self.day = now.day + self.month = now.month + self.second = now.second + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cythonize.sh b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cythonize.sh new file mode 100644 index 00000000..9e41c509 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/cythonize.sh @@ -0,0 +1,15 @@ +echo "Cythonizing .pyx files to C files" + +cython benchmarking.pyx +cython casts.pyx +cython file.pyx +cython ink.pyx +cython network.pyx +cython python.pyx +cython shell.pyx +cython cstate.pyx +cython system.pyx +cython types.pyx + + +echo "Cythonization is complete" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.c new file mode 100644 index 00000000..b5ecb220 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.c @@ -0,0 +1,12542 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:13 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__file +#define __PYX_HAVE_API__lib__Naked__toolshed__c__file +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "file.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.file' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.file" +int __pyx_module_is_main_lib__Naked__toolshed__c__file = 0; + +/* Implementation of 'lib.Naked.toolshed.c.file' */ +static PyObject *__pyx_builtin_IOError; +static PyObject *__pyx_builtin_open; +static PyObject *__pyx_builtin_UnicodeEncodeError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_2IO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_2append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_4append_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_6gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_compression_level); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_8write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_10write_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_the_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_12write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_binary_data); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_14safe_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_16safe_write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_file_data); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_18write_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_2read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_4read_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_6read_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_8readlines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_10readlines_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dev_spec_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_12readlines_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_14read_gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_16read_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_a[] = "a"; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_r[] = "r"; +static char __pyx_k_w[] = "w"; +static char __pyx_k_IO[] = "IO"; +static char __pyx_k_gz[] = ".gz"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_rb[] = "rb"; +static char __pyx_k_ue[] = "ue"; +static char __pyx_k_wb[] = "wb"; +static char __pyx_k_wt[] = "wt"; +static char __pyx_k__13[] = ""; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_ioe[] = "ioe"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_NFKD[] = "NFKD"; +static char __pyx_k_UTF8[] = "UTF8"; +static char __pyx_k_data[] = "data"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_gzip[] = "gzip"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_line[] = "line"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_open[] = "open"; +static char __pyx_k_path[] = "path"; +static char __pyx_k_read[] = "read"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_text[] = "text"; +static char __pyx_k_utf8[] = "utf8"; +static char __pyx_k_UTF_8[] = "UTF-8"; +static char __pyx_k_close[] = "close"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_utf_8[] = "utf_8"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_append[] = "append"; +static char __pyx_k_codecs[] = "codecs"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_exists[] = "exists"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_reader[] = "reader"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_writer[] = "writer"; +static char __pyx_k_IOError[] = "IOError"; +static char __pyx_k_UTF_8_2[] = "UTF_8"; +static char __pyx_k_os_path[] = "os.path"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_read_as[] = "read_as"; +static char __pyx_k_utf_8_2[] = "utf-8"; +static char __pyx_k_appender[] = "appender"; +static char __pyx_k_encoding[] = "encoding"; +static char __pyx_k_endswith[] = "endswith"; +static char __pyx_k_filepath[] = "filepath"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_read_bin[] = "read_bin"; +static char __pyx_k_write_as[] = "write_as"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_IO___init[] = "IO.__init__"; +static char __pyx_k_data_list[] = "data_list"; +static char __pyx_k_file_data[] = "file_data"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_norm_data[] = "norm_data"; +static char __pyx_k_norm_line[] = "norm_line"; +static char __pyx_k_norm_text[] = "norm_text"; +static char __pyx_k_normalize[] = "normalize"; +static char __pyx_k_read_gzip[] = "read_gzip"; +static char __pyx_k_read_utf8[] = "read_utf8"; +static char __pyx_k_readlines[] = "readlines"; +static char __pyx_k_write_bin[] = "write_bin"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_FileReader[] = "FileReader"; +static char __pyx_k_FileWriter[] = "FileWriter"; +static char __pyx_k_bin_reader[] = "bin_reader"; +static char __pyx_k_bin_writer[] = "bin_writer"; +static char __pyx_k_safe_write[] = "safe_write"; +static char __pyx_k_textstring[] = "textstring"; +static char __pyx_k_uni_reader[] = "uni_reader"; +static char __pyx_k_write_utf8[] = "write_utf8"; +static char __pyx_k_append_utf8[] = "append_utf8"; +static char __pyx_k_binary_data[] = "binary_data"; +static char __pyx_k_file_exists[] = "file_exists"; +static char __pyx_k_gzip_reader[] = "gzip_reader"; +static char __pyx_k_gzip_writer[] = "gzip_writer"; +static char __pyx_k_unicodedata[] = "unicodedata"; +static char __pyx_k_RuntimeError[] = "RuntimeError"; +static char __pyx_k_readlines_as[] = "readlines_as"; +static char __pyx_k_the_encoding[] = "the_encoding"; +static char __pyx_k_compresslevel[] = "compresslevel"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_readlines_utf8[] = "readlines_utf8"; +static char __pyx_k_safe_write_bin[] = "safe_write_bin"; +static char __pyx_k_system_default[] = "system_default"; +static char __pyx_k_FileReader_read[] = "FileReader.read"; +static char __pyx_k_FileWriter_gzip[] = "FileWriter.gzip"; +static char __pyx_k_FileWriter_write[] = "FileWriter.write"; +static char __pyx_k_FileReader___init[] = "FileReader.__init__"; +static char __pyx_k_FileWriter___init[] = "FileWriter.__init__"; +static char __pyx_k_FileWriter_append[] = "FileWriter.append"; +static char __pyx_k_compression_level[] = "compression_level"; +static char __pyx_k_dev_spec_encoding[] = "dev_spec_encoding"; +static char __pyx_k_FileReader_read_as[] = "FileReader.read_as"; +static char __pyx_k_UnicodeEncodeError[] = "UnicodeEncodeError"; +static char __pyx_k_modified_text_list[] = "modified_text_list"; +static char __pyx_k_FileReader_read_bin[] = "FileReader.read_bin"; +static char __pyx_k_FileWriter_write_as[] = "FileWriter.write_as"; +static char __pyx_k_FileReader_read_gzip[] = "FileReader.read_gzip"; +static char __pyx_k_FileReader_read_utf8[] = "FileReader.read_utf8"; +static char __pyx_k_FileReader_readlines[] = "FileReader.readlines"; +static char __pyx_k_FileWriter_write_bin[] = "FileWriter.write_bin"; +static char __pyx_k_FileWriter_safe_write[] = "FileWriter.safe_write"; +static char __pyx_k_FileWriter_write_utf8[] = "FileWriter.write_utf8"; +static char __pyx_k_Naked_toolshed_system[] = "Naked.toolshed.system"; +static char __pyx_k_FileWriter_append_utf8[] = "FileWriter.append_utf8"; +static char __pyx_k_FileReader_readlines_as[] = "FileReader.readlines_as"; +static char __pyx_k_FileReader_readlines_utf8[] = "FileReader.readlines_utf8"; +static char __pyx_k_FileWriter_safe_write_bin[] = "FileWriter.safe_write_bin"; +static char __pyx_k_lib_Naked_toolshed_c_file[] = "lib.Naked.toolshed.c.file"; +static char __pyx_k_Naked_Framework_Error_Unable_to[] = "Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py)."; +static char __pyx_k_The_file_specified_for_the_text[] = "The file specified for the text append does not exist (Naked.toolshed.file.py:append)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/file.pyx"; +static char __pyx_k_The_text_encoding_was_not_specif[] = "The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as)."; +static char __pyx_k_The_text_file_encoding_was_not_s[] = "The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_2[] = "Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_3[] = "Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_4[] = "Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_5[] = "Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_6[] = "Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_7[] = "Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_8[] = "Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_9[] = "Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)"; +static char __pyx_k_The_file_specified_for_the_text_2[] = "The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_10[] = "Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_11[] = "Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_12[] = "Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_13[] = "Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_14[] = "Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_15[] = "Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py)."; +static char __pyx_k_The_text_file_encoding_was_not_s_2[] = "The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as)."; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_FileReader; +static PyObject *__pyx_n_s_FileReader___init; +static PyObject *__pyx_n_s_FileReader_read; +static PyObject *__pyx_n_s_FileReader_read_as; +static PyObject *__pyx_n_s_FileReader_read_bin; +static PyObject *__pyx_n_s_FileReader_read_gzip; +static PyObject *__pyx_n_s_FileReader_read_utf8; +static PyObject *__pyx_n_s_FileReader_readlines; +static PyObject *__pyx_n_s_FileReader_readlines_as; +static PyObject *__pyx_n_s_FileReader_readlines_utf8; +static PyObject *__pyx_n_s_FileWriter; +static PyObject *__pyx_n_s_FileWriter___init; +static PyObject *__pyx_n_s_FileWriter_append; +static PyObject *__pyx_n_s_FileWriter_append_utf8; +static PyObject *__pyx_n_s_FileWriter_gzip; +static PyObject *__pyx_n_s_FileWriter_safe_write; +static PyObject *__pyx_n_s_FileWriter_safe_write_bin; +static PyObject *__pyx_n_s_FileWriter_write; +static PyObject *__pyx_n_s_FileWriter_write_as; +static PyObject *__pyx_n_s_FileWriter_write_bin; +static PyObject *__pyx_n_s_FileWriter_write_utf8; +static PyObject *__pyx_n_s_IO; +static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_IO___init; +static PyObject *__pyx_n_s_NFKD; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_10; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_11; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_12; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_13; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_14; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_15; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_9; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_system; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_kp_s_The_file_specified_for_the_text; +static PyObject *__pyx_kp_s_The_file_specified_for_the_text_2; +static PyObject *__pyx_kp_s_The_text_encoding_was_not_specif; +static PyObject *__pyx_kp_s_The_text_file_encoding_was_not_s; +static PyObject *__pyx_kp_s_The_text_file_encoding_was_not_s_2; +static PyObject *__pyx_n_s_UTF8; +static PyObject *__pyx_kp_s_UTF_8; +static PyObject *__pyx_n_s_UTF_8_2; +static PyObject *__pyx_n_s_UnicodeEncodeError; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__13; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_append_utf8; +static PyObject *__pyx_n_s_appender; +static PyObject *__pyx_n_s_bin_reader; +static PyObject *__pyx_n_s_bin_writer; +static PyObject *__pyx_n_s_binary_data; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_codecs; +static PyObject *__pyx_n_s_compression_level; +static PyObject *__pyx_n_s_compresslevel; +static PyObject *__pyx_n_s_data; +static PyObject *__pyx_n_s_data_list; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_dev_spec_encoding; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_endswith; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exists; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_file_data; +static PyObject *__pyx_n_s_file_exists; +static PyObject *__pyx_n_s_filepath; +static PyObject *__pyx_kp_s_gz; +static PyObject *__pyx_n_s_gzip; +static PyObject *__pyx_n_s_gzip_reader; +static PyObject *__pyx_n_s_gzip_writer; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_ioe; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_file; +static PyObject *__pyx_n_s_line; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_modified_text_list; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_norm_data; +static PyObject *__pyx_n_s_norm_line; +static PyObject *__pyx_n_s_norm_text; +static PyObject *__pyx_n_s_normalize; +static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_os_path; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_r; +static PyObject *__pyx_n_s_rb; +static PyObject *__pyx_n_s_read; +static PyObject *__pyx_n_s_read_as; +static PyObject *__pyx_n_s_read_bin; +static PyObject *__pyx_n_s_read_gzip; +static PyObject *__pyx_n_s_read_utf8; +static PyObject *__pyx_n_s_reader; +static PyObject *__pyx_n_s_readlines; +static PyObject *__pyx_n_s_readlines_as; +static PyObject *__pyx_n_s_readlines_utf8; +static PyObject *__pyx_n_s_safe_write; +static PyObject *__pyx_n_s_safe_write_bin; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_system_default; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_text; +static PyObject *__pyx_n_s_textstring; +static PyObject *__pyx_n_s_the_encoding; +static PyObject *__pyx_n_s_ue; +static PyObject *__pyx_n_s_uni_reader; +static PyObject *__pyx_n_s_unicodedata; +static PyObject *__pyx_n_s_utf8; +static PyObject *__pyx_n_s_utf_8; +static PyObject *__pyx_kp_s_utf_8_2; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_wb; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_write_as; +static PyObject *__pyx_n_s_write_bin; +static PyObject *__pyx_n_s_write_utf8; +static PyObject *__pyx_n_s_writer; +static PyObject *__pyx_n_s_wt; +static PyObject *__pyx_int_6; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__56; +static PyObject *__pyx_tuple__58; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__57; +static PyObject *__pyx_codeobj__59; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__87; + +/* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.IO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_2IO___init__(__pyx_self, __pyx_v_self, __pyx_v_filepath); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_2IO___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/file.pyx":14 + * class IO: + * def __init__(self,filepath): + * self.filepath = filepath # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filepath, __pyx_v_filepath) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.IO.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter___init__(__pyx_self, __pyx_v_self, __pyx_v_filepath); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/file.pyx":22 + * class FileWriter(IO): + * def __init__(self, filepath): + * IO.__init__(self, filepath) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append = {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_2append(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_2append(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_appender = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append", 0); + + /* "lib/Naked/toolshed/c/file.pyx":30 + * #------------------------------------------------------------------------------ + * def append(self, text): + * try: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":31 + * def append(self, text): + * try: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":32 + * try: + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) # <<<<<<<<<<<<<< + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":33 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") # <<<<<<<<<<<<<< + * with open(self.filepath, 'a') as appender: + * appender.write(text) + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":34 + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: # <<<<<<<<<<<<<< + * appender.write(text) + * except UnicodeEncodeError as ue: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_a); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_a); + __Pyx_GIVEREF(__pyx_n_s_a); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_9); + __pyx_v_appender = __pyx_t_9; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":35 + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: + * appender.write(text) # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * self.append_utf8(text) #try writing as utf-8 + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_appender, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":34 + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: # <<<<<<<<<<<<<< + * appender.write(text) + * except UnicodeEncodeError as ue: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_9); + __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_8) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__2, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":36 + * with open(self.filepath, 'a') as appender: + * appender.write(text) + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * self.append_utf8(text) #try writing as utf-8 + * except Exception as e: + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ue = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":37 + * appender.write(text) + * except UnicodeEncodeError as ue: + * self.append_utf8(text) #try writing as utf-8 # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_append_utf8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":38 + * except UnicodeEncodeError as ue: + * self.append_utf8(text) #try writing as utf-8 + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":39 + * self.append_utf8(text) #try writing as utf-8 + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/file.pyx":40 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L35; + } + __pyx_L35:; + + /* "lib/Naked/toolshed/c/file.pyx":41 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_appender); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8 = {__Pyx_NAMESTR("append_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("append_utf8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("append_utf8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "append_utf8") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("append_utf8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_4append_utf8(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_4append_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_appender = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("append_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":49 + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): + * try: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":50 + * def append_utf8(self, text): + * try: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":51 + * try: + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): # <<<<<<<<<<<<<< + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + * import codecs + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":52 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") # <<<<<<<<<<<<<< + * import codecs + * import unicodedata + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":53 + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + * import codecs # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":54 + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + * import codecs + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_unicodedata = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":55 + * import codecs + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + * appender.write(norm_text) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_norm_text = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":56 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: # <<<<<<<<<<<<<< + * appender.write(norm_text) + * except Exception as e: + */ + /*with:*/ { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_s_a) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_n_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + __Pyx_INCREF(__pyx_t_5); + __pyx_v_appender = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":57 + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + * appender.write(norm_text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_appender, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":56 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: # <<<<<<<<<<<<<< + * appender.write(norm_text) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_9, __pyx_t_5); + __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_10) { + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":58 + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + * appender.write(norm_text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/file.pyx":59 + * appender.write(norm_text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/file.pyx":60 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":61 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.append_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_appender); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip = {__Pyx_NAMESTR("gzip"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_compression_level = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gzip (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,&__pyx_n_s_compression_level,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)__pyx_int_6)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("gzip", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression_level); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gzip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + __pyx_v_compression_level = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gzip", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_6gzip(__pyx_self, __pyx_v_self, __pyx_v_text, __pyx_v_compression_level); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_6gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_compression_level) { + PyObject *__pyx_v_gzip = NULL; + PyObject *__pyx_v_gzip_writer = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_binary_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("gzip", 0); + + /* "lib/Naked/toolshed/c/file.pyx":72 + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): + * try: # <<<<<<<<<<<<<< + * import gzip + * if not self.filepath.endswith(".gz"): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":73 + * def gzip(self, text, compression_level=6): + * try: + * import gzip # <<<<<<<<<<<<<< + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_gzip = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":74 + * try: + * import gzip + * if not self.filepath.endswith(".gz"): # <<<<<<<<<<<<<< + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_endswith); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":75 + * import gzip + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" # <<<<<<<<<<<<<< + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(text) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_gz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filepath, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/file.pyx":76 + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compresslevel, __pyx_v_compression_level) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_9, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + __Pyx_INCREF(__pyx_t_8); + __pyx_v_gzip_writer = __pyx_t_8; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":77 + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(text) # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * import unicodedata + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":76 + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_6 = ((!(__pyx_t_7 != 0)) != 0); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_9, __pyx_t_8); + __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_10) { + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__8, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":78 + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_ue = __pyx_t_9; + + /* "lib/Naked/toolshed/c/file.pyx":79 + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * import codecs + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_unicodedata = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":80 + * except UnicodeEncodeError as ue: + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write # <<<<<<<<<<<<<< + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_norm_text = __pyx_t_17; + __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":81 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * import codecs # <<<<<<<<<<<<<< + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + */ + __pyx_t_17 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_v_codecs = __pyx_t_17; + __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":82 + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") # <<<<<<<<<<<<<< + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(binary_data) + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_encode); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __Pyx_INCREF(__pyx_n_s_utf_8); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_utf_8); + __Pyx_GIVEREF(__pyx_n_s_utf_8); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_v_binary_data = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":83 + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(binary_data) + * except Exception as e: + */ + /*with:*/ { + if (unlikely(!__pyx_v_gzip)) { __Pyx_RaiseUnboundLocalError("gzip"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_16 = 0; + __pyx_t_16 = PyDict_New(); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_compresslevel, __pyx_v_compression_level) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_18, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = __Pyx_PyObject_LookupSpecial(__pyx_t_18, __pyx_n_s_enter); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L33_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L33_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + __Pyx_INCREF(__pyx_t_17); + __Pyx_XDECREF_SET(__pyx_v_gzip_writer, __pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":84 + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(binary_data) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(__pyx_v_binary_data); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_binary_data); + __Pyx_GIVEREF(__pyx_v_binary_data); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L39_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L46_try_end; + __pyx_L39_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":83 + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(binary_data) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_18, &__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_16, __pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_6 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ErrRestore(__pyx_t_16, __pyx_t_18, __pyx_t_17); + __pyx_t_16 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} + } + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L40_exception_handled; + } + __pyx_L41_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11); + goto __pyx_L5_except_error; + __pyx_L40_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11); + __pyx_L46_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_10) { + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__9, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + goto __pyx_L38; + } + __pyx_L38:; + } + goto __pyx_L51; + __pyx_L33_error:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L5_except_error; + __pyx_L51:; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":85 + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + * gzip_writer.write(binary_data) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/file.pyx":86 + * gzip_writer.write(binary_data) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":87 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + goto __pyx_L54; + } + __pyx_L54:; + + /* "lib/Naked/toolshed/c/file.pyx":88 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gzip); + __Pyx_XDECREF(__pyx_v_gzip_writer); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_binary_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_8write(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_8write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_writer = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write", 0); + + /* "lib/Naked/toolshed/c/file.pyx":97 + * #------------------------------------------------------------------------------ + * def write(self, text): + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":98 + * def write(self, text): + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wt); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_wt); + __Pyx_GIVEREF(__pyx_n_s_wt); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_writer = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":99 + * try: + * with open(self.filepath, 'wt') as writer: + * writer.write(text) # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # attempt to write with utf-8 encoding + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":98 + * def write(self, text): + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * except UnicodeEncodeError as ue: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_7); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L16:; + } + goto __pyx_L29; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3_error; + __pyx_L29:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":100 + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * self.write_utf8(text) # attempt to write with utf-8 encoding + * except Exception as e: + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ue = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":101 + * writer.write(text) + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # attempt to write with utf-8 encoding # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_utf8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":102 + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # attempt to write with utf-8 encoding + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":103 + * self.write_utf8(text) # attempt to write with utf-8 encoding + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":104 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L34; + } + __pyx_L34:; + + /* "lib/Naked/toolshed/c/file.pyx":105 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_writer); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as = {__Pyx_NAMESTR("write_as"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_the_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_as (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,&__pyx_n_s_the_encoding,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s__13)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_as", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_encoding); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_as") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + __pyx_v_the_encoding = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_as", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_10write_as(__pyx_self, __pyx_v_self, __pyx_v_text, __pyx_v_the_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_10write_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text, PyObject *__pyx_v_the_encoding) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_as", 0); + + /* "lib/Naked/toolshed/c/file.pyx":113 + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): + * try: # <<<<<<<<<<<<<< + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":114 + * def write_as(self, text, the_encoding=""): + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception # <<<<<<<<<<<<<< + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_the_encoding, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":115 + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":116 + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + * f.write(text) + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":117 + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: # <<<<<<<<<<<<<< + * f.write(text) + * except Exception as e: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_v_the_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":118 + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + * f.write(text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":117 + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: # <<<<<<<<<<<<<< + * f.write(text) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_14 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_8, __pyx_t_7); + __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__15, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":119 + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + * f.write(text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/file.pyx":120 + * f.write(text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":121 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":122 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin = {__Pyx_NAMESTR("write_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_binary_data = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_bin (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_binary_data,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binary_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_bin", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_bin") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_binary_data = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_bin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_12write_bin(__pyx_self, __pyx_v_self, __pyx_v_binary_data); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_12write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_binary_data) { + PyObject *__pyx_v_bin_writer = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_bin", 0); + + /* "lib/Naked/toolshed/c/file.pyx":130 + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'wb') as bin_writer: + * bin_writer.write(binary_data) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":131 + * def write_bin(self, binary_data): + * try: + * with open(self.filepath, 'wb') as bin_writer: # <<<<<<<<<<<<<< + * bin_writer.write(binary_data) + * except Exception as e: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_bin_writer = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":132 + * try: + * with open(self.filepath, 'wb') as bin_writer: + * bin_writer.write(binary_data) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_binary_data); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_binary_data); + __Pyx_GIVEREF(__pyx_v_binary_data); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":131 + * def write_bin(self, binary_data): + * try: + * with open(self.filepath, 'wb') as bin_writer: # <<<<<<<<<<<<<< + * bin_writer.write(binary_data) + * except Exception as e: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_7); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__17, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L16:; + } + goto __pyx_L29; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3_error; + __pyx_L29:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":133 + * with open(self.filepath, 'wb') as bin_writer: + * bin_writer.write(binary_data) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":134 + * bin_writer.write(binary_data) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":135 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L32; + } + __pyx_L32:; + + /* "lib/Naked/toolshed/c/file.pyx":136 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bin_writer); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write = {__Pyx_NAMESTR("safe_write"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("safe_write (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("safe_write", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "safe_write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("safe_write", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_14safe_write(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_14safe_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_writer = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ue = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("safe_write", 0); + + /* "lib/Naked/toolshed/c/file.pyx":145 + * #------------------------------------------------------------------------------ + * def safe_write(self, text): + * import os.path # <<<<<<<<<<<<<< + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_os = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":146 + * def safe_write(self, text): + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/file.pyx":147 + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + */ + { + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":148 + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * return True + */ + /*with:*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_wt); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_wt); + __Pyx_GIVEREF(__pyx_n_s_wt); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_2); + __pyx_v_writer = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":149 + * try: + * with open(self.filepath, 'wt') as writer: + * writer.write(text) # <<<<<<<<<<<<<< + * return True + * except UnicodeEncodeError as ue: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":148 + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * return True + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestore(__pyx_t_3, __pyx_t_1, __pyx_t_2); + __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L4_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__19, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_error; + __pyx_L30:; + } + + /* "lib/Naked/toolshed/c/file.pyx":150 + * with open(self.filepath, 'wt') as writer: + * writer.write(text) + * return True # <<<<<<<<<<<<<< + * except UnicodeEncodeError as ue: + * self.write_utf8(text) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L8_try_return; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L11_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":151 + * writer.write(text) + * return True + * except UnicodeEncodeError as ue: # <<<<<<<<<<<<<< + * self.write_utf8(text) + * return True + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ue = __pyx_t_1; + + /* "lib/Naked/toolshed/c/file.pyx":152 + * return True + * except UnicodeEncodeError as ue: + * self.write_utf8(text) # <<<<<<<<<<<<<< + * return True + * except Exception as e: + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_utf8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_16, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":153 + * except UnicodeEncodeError as ue: + * self.write_utf8(text) + * return True # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L7_except_return; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5_exception_handled; + } + + /* "lib/Naked/toolshed/c/file.pyx":154 + * self.write_utf8(text) + * return True + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_e = __pyx_t_1; + + /* "lib/Naked/toolshed/c/file.pyx":155 + * return True + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":156 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * else: + */ + __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L35; + } + __pyx_L35:; + + /* "lib/Naked/toolshed/c/file.pyx":157 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * else: + * return False # if file exists, do not write and return False + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L0; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L11_try_end:; + } + } + /*else*/ { + + /* "lib/Naked/toolshed/c/file.pyx":159 + * raise e + * else: + * return False # if file exists, do not write and return False # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_writer); + __Pyx_XDECREF(__pyx_v_ue); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin = {__Pyx_NAMESTR("safe_write_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_file_data = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("safe_write_bin (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_file_data,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_data)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("safe_write_bin", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "safe_write_bin") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_file_data = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("safe_write_bin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_16safe_write_bin(__pyx_self, __pyx_v_self, __pyx_v_file_data); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_16safe_write_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_file_data) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_writer = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("safe_write_bin", 0); + + /* "lib/Naked/toolshed/c/file.pyx":167 + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): + * try: # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":168 + * def safe_write_bin(self, file_data): + * try: + * import os.path # <<<<<<<<<<<<<< + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":169 + * try: + * import os.path + * if not os.path.exists(self.filepath): # <<<<<<<<<<<<<< + * with open(self.filepath, 'wb') as writer: + * writer.write(file_data) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = ((!__pyx_t_7) != 0); + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/file.pyx":170 + * import os.path + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: # <<<<<<<<<<<<<< + * writer.write(file_data) + * return True + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_5); + __pyx_v_writer = __pyx_t_5; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":171 + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: + * writer.write(file_data) # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_file_data); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_file_data); + __Pyx_GIVEREF(__pyx_v_file_data); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":170 + * import os.path + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: # <<<<<<<<<<<<<< + * writer.write(file_data) + * return True + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_8 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_4, __pyx_t_5); + __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__21, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + + /* "lib/Naked/toolshed/c/file.pyx":172 + * with open(self.filepath, 'wb') as writer: + * writer.write(file_data) + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/file.pyx":174 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":175 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":176 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/file.pyx":177 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":178 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.safe_write_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_writer); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8 = {__Pyx_NAMESTR("write_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_text = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("write_utf8 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_text,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("write_utf8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_utf8") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_text = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("write_utf8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_18write_utf8(__pyx_self, __pyx_v_self, __pyx_v_text); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileWriter_18write_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_ioe = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("write_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":189 + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): + * try: # <<<<<<<<<<<<<< + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":190 + * def write_utf8(self, text): + * try: + * import codecs # <<<<<<<<<<<<<< + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + * except IOError as ioe: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_codecs = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":191 + * try: + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') # <<<<<<<<<<<<<< + * except IOError as ioe: + * if DEBUG_FLAG: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoding, __pyx_n_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_f = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":192 + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + * except IOError as ioe: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_IOError); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ioe = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":193 + * f = codecs.open(self.filepath, encoding='utf_8', mode='w') + * except IOError as ioe: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + * raise ioe + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":194 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":195 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + * raise ioe # <<<<<<<<<<<<<< + * try: + * import unicodedata + */ + __Pyx_Raise(__pyx_v_ioe, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":196 + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + * raise ioe + * try: # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":197 + * raise ioe + * try: + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * f.write(norm_text) + */ + __pyx_t_6 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_unicodedata = __pyx_t_6; + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":198 + * try: + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write # <<<<<<<<<<<<<< + * f.write(norm_text) + * except Exception as e: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_norm_text = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":199 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * f.write(norm_text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":200 + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * f.write(norm_text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":201 + * f.write(norm_text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":202 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L27; + } + __pyx_L27:; + + /* "lib/Naked/toolshed/c/file.pyx":203 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * finally: + * f.close() + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + goto __pyx_L15_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_L24_try_end:; + } + } + + /* "lib/Naked/toolshed/c/file.pyx":205 + * raise e + * finally: + * f.close() # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16; + } + /*exception exit:*/{ + __pyx_L15_error:; + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + __pyx_L29_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + goto __pyx_L1_error; + } + __pyx_L16:; + } + + /* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileWriter.write_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_ioe); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader___init__(__pyx_self, __pyx_v_self, __pyx_v_filepath); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/file.pyx":214 + * class FileReader(IO): + * def __init__(self, filepath): + * IO.__init__(self, filepath) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read = {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_2read(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_2read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read", 0); + + /* "lib/Naked/toolshed/c/file.pyx":223 + * #------------------------------------------------------------------------------ + * def read(self): + * try: # <<<<<<<<<<<<<< + * return self.read_utf8() #reads everything as unicode in utf8 encoding + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":224 + * def read(self): + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_read_utf8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":225 + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_6) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":226 + * return self.read_utf8() #reads everything as unicode in utf8 encoding + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":227 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":228 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin = {__Pyx_NAMESTR("read_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_bin (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_4read_bin(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_4read_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_bin_reader = NULL; + PyObject *__pyx_v_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_bin", 0); + + /* "lib/Naked/toolshed/c/file.pyx":237 + * #------------------------------------------------------------------------------ + * def read_bin(self): + * try: # <<<<<<<<<<<<<< + * with open(self.filepath, 'rb') as bin_reader: + * data = bin_reader.read() + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":238 + * def read_bin(self): + * try: + * with open(self.filepath, 'rb') as bin_reader: # <<<<<<<<<<<<<< + * data = bin_reader.read() + * return data + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_bin_reader = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":239 + * try: + * with open(self.filepath, 'rb') as bin_reader: + * data = bin_reader.read() # <<<<<<<<<<<<<< + * return data + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_reader, __pyx_n_s_read); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_data = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":240 + * with open(self.filepath, 'rb') as bin_reader: + * data = bin_reader.read() + * return data # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_data); + __pyx_r = __pyx_v_data; + goto __pyx_L21_try_return; + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":238 + * def read_bin(self): + * try: + * with open(self.filepath, 'rb') as bin_reader: # <<<<<<<<<<<<<< + * data = bin_reader.read() + * return data + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_7, __pyx_t_5); + __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_6) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__26, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L14_return: { + __pyx_t_10 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_6) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__27, NULL); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L7_try_return; + } + __pyx_L16:; + } + goto __pyx_L29; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L3_error; + __pyx_L29:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":241 + * data = bin_reader.read() + * return data + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/file.pyx":242 + * return data + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":243 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L32; + } + __pyx_L32:; + + /* "lib/Naked/toolshed/c/file.pyx":244 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bin_reader); + __Pyx_XDECREF(__pyx_v_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as = {__Pyx_NAMESTR("read_as"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_as (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_encoding,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_encoding)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("read_as", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_as") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_the_encoding = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_as", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_6read_as(__pyx_self, __pyx_v_self, __pyx_v_the_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_6read_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_encoding) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_as", 0); + + /* "lib/Naked/toolshed/c/file.pyx":253 + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): + * try: # <<<<<<<<<<<<<< + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":254 + * def read_as(self, the_encoding): + * try: + * if the_encoding == "": # <<<<<<<<<<<<<< + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_the_encoding, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":255 + * try: + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":256 + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + * data = f.read() + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":257 + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: # <<<<<<<<<<<<<< + * data = f.read() + * return data + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_v_the_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":258 + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + * data = f.read() # <<<<<<<<<<<<<< + * return data + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_data = __pyx_t_8; + __pyx_t_8 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":257 + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: # <<<<<<<<<<<<<< + * data = f.read() + * return data + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_8, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_14 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_14) { + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6); + __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__30, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L17:; + } + goto __pyx_L30; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + + /* "lib/Naked/toolshed/c/file.pyx":259 + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + * data = f.read() + * return data # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } + __Pyx_INCREF(__pyx_v_data); + __pyx_r = __pyx_v_data; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":260 + * data = f.read() + * return data + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/file.pyx":261 + * return data + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_14) { + + /* "lib/Naked/toolshed/c/file.pyx":262 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":263 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines = {__Pyx_NAMESTR("readlines"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readlines (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_8readlines(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_8readlines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("readlines", 0); + + /* "lib/Naked/toolshed/c/file.pyx":272 + * #------------------------------------------------------------------------------ + * def readlines(self): + * try: # <<<<<<<<<<<<<< + * return self.readlines_utf8() # read as utf8 encoded file + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":273 + * def readlines(self): + * try: + * return self.readlines_utf8() # read as utf8 encoded file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_readlines_utf8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":274 + * try: + * return self.readlines_utf8() # read as utf8 encoded file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_6) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":275 + * return self.readlines_utf8() # read as utf8 encoded file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":276 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":277 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as = {__Pyx_NAMESTR("readlines_as"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_dev_spec_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readlines_as (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dev_spec_encoding,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev_spec_encoding)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("readlines_as", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readlines_as") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_dev_spec_encoding = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("readlines_as", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_10readlines_as(__pyx_self, __pyx_v_self, __pyx_v_dev_spec_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_10readlines_as(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dev_spec_encoding) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_reader = NULL; + PyObject *__pyx_v_data_list = NULL; + PyObject *__pyx_v_line = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("readlines_as", 0); + + /* "lib/Naked/toolshed/c/file.pyx":286 + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): + * try: # <<<<<<<<<<<<<< + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":287 + * def readlines_as(self, dev_spec_encoding): + * try: + * if dev_spec_encoding == "": # <<<<<<<<<<<<<< + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_dev_spec_encoding, __pyx_kp_s__13, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/file.pyx":288 + * try: + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + + /* "lib/Naked/toolshed/c/file.pyx":289 + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + * data_list = [] + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":290 + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: # <<<<<<<<<<<<<< + * data_list = [] + * for line in reader: + */ + /*with:*/ { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encoding, __pyx_v_dev_spec_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L12_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_reader = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":291 + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + * data_list = [] # <<<<<<<<<<<<<< + * for line in reader: + * data_list.append(line) + */ + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_v_data_list = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":292 + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + * data_list = [] + * for line in reader: # <<<<<<<<<<<<<< + * data_list.append(line) + * return data_list + */ + if (PyList_CheckExact(__pyx_v_reader) || PyTuple_CheckExact(__pyx_v_reader)) { + __pyx_t_7 = __pyx_v_reader; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_reader); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = Py_TYPE(__pyx_t_7)->tp_iternext; + } + for (;;) { + if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_7)) { + if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #endif + } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_7)) { + if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + #endif + } else { + __pyx_t_8 = __pyx_t_14(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_8); + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":293 + * data_list = [] + * for line in reader: + * data_list.append(line) # <<<<<<<<<<<<<< + * return data_list + * except Exception as e: + */ + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_data_list, __pyx_v_line); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":294 + * for line in reader: + * data_list.append(line) + * return data_list # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_data_list); + __pyx_r = __pyx_v_data_list; + goto __pyx_L22_try_return; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L25_try_end; + __pyx_L18_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":290 + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: # <<<<<<<<<<<<<< + * data_list = [] + * for line in reader: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_16); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_17 = ((!(__pyx_t_4 != 0)) != 0); + if (__pyx_t_17) { + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_6); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L19_exception_handled; + } + __pyx_L20_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L3_error; + __pyx_L22_try_return:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L15_return; + __pyx_L19_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L25_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_9) { + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__34, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + goto __pyx_L17; + } + __pyx_L15_return: { + __pyx_t_12 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_9) { + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__35, NULL); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L7_try_return; + } + __pyx_L17:; + } + goto __pyx_L32; + __pyx_L12_error:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L3_error; + __pyx_L32:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":295 + * data_list.append(line) + * return data_list + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/file.pyx":296 + * return data_list + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_17) { + + /* "lib/Naked/toolshed/c/file.pyx":297 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L35; + } + __pyx_L35:; + + /* "lib/Naked/toolshed/c/file.pyx":298 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_as", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_reader); + __Pyx_XDECREF(__pyx_v_data_list); + __Pyx_XDECREF(__pyx_v_line); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8 = {__Pyx_NAMESTR("readlines_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("readlines_utf8 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_12readlines_utf8(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_12readlines_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_uni_reader = NULL; + PyObject *__pyx_v_modified_text_list = NULL; + PyObject *__pyx_v_line = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_line = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + int __pyx_t_17; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("readlines_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":307 + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): + * try: # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":308 + * def readlines_utf8(self): + * try: + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + * modified_text_list = [] + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_codecs = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":309 + * try: + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: # <<<<<<<<<<<<<< + * modified_text_list = [] + * for line in uni_reader: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoding, __pyx_kp_s_utf_8_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + __Pyx_INCREF(__pyx_t_6); + __pyx_v_uni_reader = __pyx_t_6; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":310 + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + * modified_text_list = [] # <<<<<<<<<<<<<< + * for line in uni_reader: + * import unicodedata + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_modified_text_list = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":311 + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + * modified_text_list = [] + * for line in uni_reader: # <<<<<<<<<<<<<< + * import unicodedata + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + */ + if (PyList_CheckExact(__pyx_v_uni_reader) || PyTuple_CheckExact(__pyx_v_uni_reader)) { + __pyx_t_6 = __pyx_v_uni_reader; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_uni_reader); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; + } + for (;;) { + if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_6)) { + if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #endif + } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_6)) { + if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_13(__pyx_t_6); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":312 + * modified_text_list = [] + * for line in uni_reader: + * import unicodedata # <<<<<<<<<<<<<< + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + * modified_text_list.append(norm_line) + */ + __pyx_t_7 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_unicodedata, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":313 + * for line in uni_reader: + * import unicodedata + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use # <<<<<<<<<<<<<< + * modified_text_list.append(norm_line) + * return modified_text_list + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_line); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_line); + __Pyx_GIVEREF(__pyx_v_line); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_norm_line, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":314 + * import unicodedata + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + * modified_text_list.append(norm_line) # <<<<<<<<<<<<<< + * return modified_text_list + * except Exception as e: + */ + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_modified_text_list, __pyx_v_norm_line); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":315 + * norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + * modified_text_list.append(norm_line) + * return modified_text_list # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_modified_text_list); + __pyx_r = __pyx_v_modified_text_list; + goto __pyx_L21_try_return; + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":309 + * try: + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: # <<<<<<<<<<<<<< + * modified_text_list = [] + * for line in uni_reader: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_16 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_17 = ((!(__pyx_t_16 != 0)) != 0); + if (__pyx_t_17) { + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_4, __pyx_t_5); + __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L3_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_8) { + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__37, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + goto __pyx_L16; + } + __pyx_L14_return: { + __pyx_t_11 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_8) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__38, NULL); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __pyx_r = __pyx_t_11; + __pyx_t_11 = 0; + goto __pyx_L7_try_return; + } + __pyx_L16:; + } + goto __pyx_L31; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L3_error; + __pyx_L31:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":316 + * modified_text_list.append(norm_line) + * return modified_text_list + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":317 + * return modified_text_list + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_17) { + + /* "lib/Naked/toolshed/c/file.pyx":318 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L34; + } + __pyx_L34:; + + /* "lib/Naked/toolshed/c/file.pyx":319 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.readlines_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_uni_reader); + __Pyx_XDECREF(__pyx_v_modified_text_list); + __Pyx_XDECREF(__pyx_v_line); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_line); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip = {__Pyx_NAMESTR("read_gzip"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_encoding = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_gzip (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_encoding,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_n_s_system_default)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_gzip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_encoding = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("read_gzip", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_14read_gzip(__pyx_self, __pyx_v_self, __pyx_v_encoding); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_14read_gzip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_encoding) { + PyObject *__pyx_v_gzip = NULL; + PyObject *__pyx_v_gzip_reader = NULL; + PyObject *__pyx_v_file_data = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_data = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_gzip", 0); + + /* "lib/Naked/toolshed/c/file.pyx":330 + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): + * try: # <<<<<<<<<<<<<< + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":331 + * def read_gzip(self, encoding="system_default"): + * try: + * import gzip # <<<<<<<<<<<<<< + * with gzip.open(self.filepath, 'rb') as gzip_reader: + * file_data = gzip_reader.read() + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_gzip, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_gzip = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":332 + * try: + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: # <<<<<<<<<<<<<< + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + */ + /*with:*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_INCREF(__pyx_n_s_rb); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_rb); + __Pyx_GIVEREF(__pyx_n_s_rb); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L11_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + __Pyx_INCREF(__pyx_t_4); + __pyx_v_gzip_reader = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":333 + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: + * file_data = gzip_reader.read() # <<<<<<<<<<<<<< + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + * import codecs + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_gzip_reader, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_file_data = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":334 + * with gzip.open(self.filepath, 'rb') as gzip_reader: + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: # <<<<<<<<<<<<<< + * import codecs + * file_data = codecs.decode(file_data, "utf-8") + */ + __Pyx_INCREF(__pyx_v_encoding); + __pyx_t_5 = __pyx_v_encoding; + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_utf_8_2, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + if (!__pyx_t_11) { + __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_utf8, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_11; + } + if (!__pyx_t_13) { + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_utf_8, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_13; + } + if (!__pyx_t_12) { + __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_UTF_8, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_11 = __pyx_t_13; + } else { + __pyx_t_11 = __pyx_t_12; + } + if (!__pyx_t_11) { + __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_UTF8, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_13 = __pyx_t_12; + } else { + __pyx_t_13 = __pyx_t_11; + } + if (!__pyx_t_13) { + __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_UTF_8_2, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __pyx_t_12 = __pyx_t_11; + } else { + __pyx_t_12 = __pyx_t_13; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "lib/Naked/toolshed/c/file.pyx":335 + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + * import codecs # <<<<<<<<<<<<<< + * file_data = codecs.decode(file_data, "utf-8") + * import unicodedata + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_codecs = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":336 + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + * import codecs + * file_data = codecs.decode(file_data, "utf-8") # <<<<<<<<<<<<<< + * import unicodedata + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_file_data); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_file_data); + __Pyx_GIVEREF(__pyx_v_file_data); + __Pyx_INCREF(__pyx_kp_s_utf_8_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_utf_8_2); + __Pyx_GIVEREF(__pyx_kp_s_utf_8_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_file_data, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":337 + * import codecs + * file_data = codecs.decode(file_data, "utf-8") + * import unicodedata # <<<<<<<<<<<<<< + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + * return norm_data + */ + __pyx_t_6 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_unicodedata = __pyx_t_6; + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":338 + * file_data = codecs.decode(file_data, "utf-8") + * import unicodedata + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller # <<<<<<<<<<<<<< + * return norm_data + * else: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_file_data); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_file_data); + __Pyx_GIVEREF(__pyx_v_file_data); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_norm_data = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":339 + * import unicodedata + * norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + * return norm_data # <<<<<<<<<<<<<< + * else: + * return file_data + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_norm_data); + __pyx_r = __pyx_v_norm_data; + goto __pyx_L21_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/file.pyx":341 + * return norm_data + * else: + * return file_data # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_file_data); + __pyx_r = __pyx_v_file_data; + goto __pyx_L21_try_return; + } + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":332 + * try: + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: # <<<<<<<<<<<<<< + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_13 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_12) { + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_6); + __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L3_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L24_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_7) { + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__40, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + goto __pyx_L16; + } + __pyx_L14_return: { + __pyx_t_10 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_7) { + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__41, NULL); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L7_try_return; + } + __pyx_L16:; + } + goto __pyx_L30; + __pyx_L11_error:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L3_error; + __pyx_L30:; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":342 + * else: + * return file_data + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + */ + __pyx_t_16 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_16) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/file.pyx":343 + * return file_data + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_12) { + + /* "lib/Naked/toolshed/c/file.pyx":344 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + goto __pyx_L33; + } + __pyx_L33:; + + /* "lib/Naked/toolshed/c/file.pyx":345 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_gzip", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gzip); + __Pyx_XDECREF(__pyx_v_gzip_reader); + __Pyx_XDECREF(__pyx_v_file_data); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_data); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8 = {__Pyx_NAMESTR("read_utf8"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("read_utf8 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_16read_utf8(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_4file_10FileReader_16read_utf8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_ioe = NULL; + PyObject *__pyx_v_textstring = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("read_utf8", 0); + + /* "lib/Naked/toolshed/c/file.pyx":356 + * #------------------------------------------------------------------------------ + * def read_utf8(self): + * try: # <<<<<<<<<<<<<< + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":357 + * def read_utf8(self): + * try: + * import codecs # <<<<<<<<<<<<<< + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + * except IOError as ioe: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_codecs = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":358 + * try: + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') # <<<<<<<<<<<<<< + * except IOError as ioe: + * if DEBUG_FLAG: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filepath); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoding, __pyx_n_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_f = __pyx_t_7; + __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":359 + * import codecs + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + * except IOError as ioe: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_IOError); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ioe = __pyx_t_5; + + /* "lib/Naked/toolshed/c/file.pyx":360 + * f = codecs.open(self.filepath, encoding='utf_8', mode='r') + * except IOError as ioe: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + * raise ioe + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":361 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/file.pyx":362 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + * raise ioe # <<<<<<<<<<<<<< + * try: + * textstring = f.read() + */ + __Pyx_Raise(__pyx_v_ioe, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/file.pyx":363 + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + * raise ioe + * try: # <<<<<<<<<<<<<< + * textstring = f.read() + * import unicodedata + */ + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + /*try:*/ { + + /* "lib/Naked/toolshed/c/file.pyx":364 + * raise ioe + * try: + * textstring = f.read() # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_textstring = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":365 + * try: + * textstring = f.read() + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + * return norm_text + */ + __pyx_t_5 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_unicodedata = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":366 + * textstring = f.read() + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns # <<<<<<<<<<<<<< + * return norm_text + * except Exception as e: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_textstring); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_textstring); + __Pyx_GIVEREF(__pyx_v_textstring); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L17_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_norm_text = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":367 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + * return norm_text # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_norm_text); + __pyx_r = __pyx_v_norm_text; + goto __pyx_L21_try_return; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":368 + * norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + * return norm_text + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/file.pyx":369 + * return norm_text + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/file.pyx":370 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L27; + } + __pyx_L27:; + + /* "lib/Naked/toolshed/c/file.pyx":371 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + * raise e # <<<<<<<<<<<<<< + * finally: + * f.close() + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L18_exception_handled; + } + goto __pyx_L19_except_error; + __pyx_L19_except_error:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + goto __pyx_L15_error; + __pyx_L21_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + goto __pyx_L14_return; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_L24_try_end:; + } + } + + /* "lib/Naked/toolshed/c/file.pyx":373 + * raise e + * finally: + * f.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + /*exception exit:*/{ + __pyx_L15_error:; + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L29_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + __pyx_L29_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + goto __pyx_L1_error; + } + __pyx_L14_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + + /* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.file.FileReader.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_ioe); + __Pyx_XDECREF(__pyx_v_textstring); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("file"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader, __pyx_k_FileReader, sizeof(__pyx_k_FileReader), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader___init, __pyx_k_FileReader___init, sizeof(__pyx_k_FileReader___init), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read, __pyx_k_FileReader_read, sizeof(__pyx_k_FileReader_read), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_as, __pyx_k_FileReader_read_as, sizeof(__pyx_k_FileReader_read_as), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_bin, __pyx_k_FileReader_read_bin, sizeof(__pyx_k_FileReader_read_bin), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_gzip, __pyx_k_FileReader_read_gzip, sizeof(__pyx_k_FileReader_read_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_read_utf8, __pyx_k_FileReader_read_utf8, sizeof(__pyx_k_FileReader_read_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_readlines, __pyx_k_FileReader_readlines, sizeof(__pyx_k_FileReader_readlines), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_readlines_as, __pyx_k_FileReader_readlines_as, sizeof(__pyx_k_FileReader_readlines_as), 0, 0, 1, 1}, + {&__pyx_n_s_FileReader_readlines_utf8, __pyx_k_FileReader_readlines_utf8, sizeof(__pyx_k_FileReader_readlines_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter, __pyx_k_FileWriter, sizeof(__pyx_k_FileWriter), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter___init, __pyx_k_FileWriter___init, sizeof(__pyx_k_FileWriter___init), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_append, __pyx_k_FileWriter_append, sizeof(__pyx_k_FileWriter_append), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_append_utf8, __pyx_k_FileWriter_append_utf8, sizeof(__pyx_k_FileWriter_append_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_gzip, __pyx_k_FileWriter_gzip, sizeof(__pyx_k_FileWriter_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_safe_write, __pyx_k_FileWriter_safe_write, sizeof(__pyx_k_FileWriter_safe_write), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_safe_write_bin, __pyx_k_FileWriter_safe_write_bin, sizeof(__pyx_k_FileWriter_safe_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write, __pyx_k_FileWriter_write, sizeof(__pyx_k_FileWriter_write), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write_as, __pyx_k_FileWriter_write_as, sizeof(__pyx_k_FileWriter_write_as), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write_bin, __pyx_k_FileWriter_write_bin, sizeof(__pyx_k_FileWriter_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_FileWriter_write_utf8, __pyx_k_FileWriter_write_utf8, sizeof(__pyx_k_FileWriter_write_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_IO, __pyx_k_IO, sizeof(__pyx_k_IO), 0, 0, 1, 1}, + {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_IO___init, __pyx_k_IO___init, sizeof(__pyx_k_IO___init), 0, 0, 1, 1}, + {&__pyx_n_s_NFKD, __pyx_k_NFKD, sizeof(__pyx_k_NFKD), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_k_Naked_Framework_Error_Unable_to, sizeof(__pyx_k_Naked_Framework_Error_Unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_10, __pyx_k_Naked_Framework_Error_Unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_10), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_11, __pyx_k_Naked_Framework_Error_Unable_to_11, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_11), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_12, __pyx_k_Naked_Framework_Error_Unable_to_12, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_12), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_13, __pyx_k_Naked_Framework_Error_Unable_to_13, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_13), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_14, __pyx_k_Naked_Framework_Error_Unable_to_14, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_14), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_15, __pyx_k_Naked_Framework_Error_Unable_to_15, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_15), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_k_Naked_Framework_Error_Unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_3, __pyx_k_Naked_Framework_Error_Unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_4, __pyx_k_Naked_Framework_Error_Unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_5, __pyx_k_Naked_Framework_Error_Unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_k_Naked_Framework_Error_Unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_7, __pyx_k_Naked_Framework_Error_Unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_8, __pyx_k_Naked_Framework_Error_Unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_9, __pyx_k_Naked_Framework_Error_Unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_9), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_system, __pyx_k_Naked_toolshed_system, sizeof(__pyx_k_Naked_toolshed_system), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_kp_s_The_file_specified_for_the_text, __pyx_k_The_file_specified_for_the_text, sizeof(__pyx_k_The_file_specified_for_the_text), 0, 0, 1, 0}, + {&__pyx_kp_s_The_file_specified_for_the_text_2, __pyx_k_The_file_specified_for_the_text_2, sizeof(__pyx_k_The_file_specified_for_the_text_2), 0, 0, 1, 0}, + {&__pyx_kp_s_The_text_encoding_was_not_specif, __pyx_k_The_text_encoding_was_not_specif, sizeof(__pyx_k_The_text_encoding_was_not_specif), 0, 0, 1, 0}, + {&__pyx_kp_s_The_text_file_encoding_was_not_s, __pyx_k_The_text_file_encoding_was_not_s, sizeof(__pyx_k_The_text_file_encoding_was_not_s), 0, 0, 1, 0}, + {&__pyx_kp_s_The_text_file_encoding_was_not_s_2, __pyx_k_The_text_file_encoding_was_not_s_2, sizeof(__pyx_k_The_text_file_encoding_was_not_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_UTF8, __pyx_k_UTF8, sizeof(__pyx_k_UTF8), 0, 0, 1, 1}, + {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0}, + {&__pyx_n_s_UTF_8_2, __pyx_k_UTF_8_2, sizeof(__pyx_k_UTF_8_2), 0, 0, 1, 1}, + {&__pyx_n_s_UnicodeEncodeError, __pyx_k_UnicodeEncodeError, sizeof(__pyx_k_UnicodeEncodeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_append_utf8, __pyx_k_append_utf8, sizeof(__pyx_k_append_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_appender, __pyx_k_appender, sizeof(__pyx_k_appender), 0, 0, 1, 1}, + {&__pyx_n_s_bin_reader, __pyx_k_bin_reader, sizeof(__pyx_k_bin_reader), 0, 0, 1, 1}, + {&__pyx_n_s_bin_writer, __pyx_k_bin_writer, sizeof(__pyx_k_bin_writer), 0, 0, 1, 1}, + {&__pyx_n_s_binary_data, __pyx_k_binary_data, sizeof(__pyx_k_binary_data), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1}, + {&__pyx_n_s_compresslevel, __pyx_k_compresslevel, sizeof(__pyx_k_compresslevel), 0, 0, 1, 1}, + {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, + {&__pyx_n_s_data_list, __pyx_k_data_list, sizeof(__pyx_k_data_list), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_dev_spec_encoding, __pyx_k_dev_spec_encoding, sizeof(__pyx_k_dev_spec_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_file_data, __pyx_k_file_data, sizeof(__pyx_k_file_data), 0, 0, 1, 1}, + {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1}, + {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, + {&__pyx_kp_s_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 0, 1, 0}, + {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_gzip_reader, __pyx_k_gzip_reader, sizeof(__pyx_k_gzip_reader), 0, 0, 1, 1}, + {&__pyx_n_s_gzip_writer, __pyx_k_gzip_writer, sizeof(__pyx_k_gzip_writer), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_ioe, __pyx_k_ioe, sizeof(__pyx_k_ioe), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_file, __pyx_k_lib_Naked_toolshed_c_file, sizeof(__pyx_k_lib_Naked_toolshed_c_file), 0, 0, 1, 1}, + {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_modified_text_list, __pyx_k_modified_text_list, sizeof(__pyx_k_modified_text_list), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_norm_data, __pyx_k_norm_data, sizeof(__pyx_k_norm_data), 0, 0, 1, 1}, + {&__pyx_n_s_norm_line, __pyx_k_norm_line, sizeof(__pyx_k_norm_line), 0, 0, 1, 1}, + {&__pyx_n_s_norm_text, __pyx_k_norm_text, sizeof(__pyx_k_norm_text), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1}, + {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, + {&__pyx_n_s_read_as, __pyx_k_read_as, sizeof(__pyx_k_read_as), 0, 0, 1, 1}, + {&__pyx_n_s_read_bin, __pyx_k_read_bin, sizeof(__pyx_k_read_bin), 0, 0, 1, 1}, + {&__pyx_n_s_read_gzip, __pyx_k_read_gzip, sizeof(__pyx_k_read_gzip), 0, 0, 1, 1}, + {&__pyx_n_s_read_utf8, __pyx_k_read_utf8, sizeof(__pyx_k_read_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1}, + {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1}, + {&__pyx_n_s_readlines_as, __pyx_k_readlines_as, sizeof(__pyx_k_readlines_as), 0, 0, 1, 1}, + {&__pyx_n_s_readlines_utf8, __pyx_k_readlines_utf8, sizeof(__pyx_k_readlines_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_safe_write, __pyx_k_safe_write, sizeof(__pyx_k_safe_write), 0, 0, 1, 1}, + {&__pyx_n_s_safe_write_bin, __pyx_k_safe_write_bin, sizeof(__pyx_k_safe_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_system_default, __pyx_k_system_default, sizeof(__pyx_k_system_default), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, + {&__pyx_n_s_textstring, __pyx_k_textstring, sizeof(__pyx_k_textstring), 0, 0, 1, 1}, + {&__pyx_n_s_the_encoding, __pyx_k_the_encoding, sizeof(__pyx_k_the_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_ue, __pyx_k_ue, sizeof(__pyx_k_ue), 0, 0, 1, 1}, + {&__pyx_n_s_uni_reader, __pyx_k_uni_reader, sizeof(__pyx_k_uni_reader), 0, 0, 1, 1}, + {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1}, + {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8_2, __pyx_k_utf_8_2, sizeof(__pyx_k_utf_8_2), 0, 0, 1, 0}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_write_as, __pyx_k_write_as, sizeof(__pyx_k_write_as), 0, 0, 1, 1}, + {&__pyx_n_s_write_bin, __pyx_k_write_bin, sizeof(__pyx_k_write_bin), 0, 0, 1, 1}, + {&__pyx_n_s_write_utf8, __pyx_k_write_utf8, sizeof(__pyx_k_write_utf8), 0, 0, 1, 1}, + {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1}, + {&__pyx_n_s_wt, __pyx_k_wt, sizeof(__pyx_k_wt), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/file.pyx":33 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") # <<<<<<<<<<<<<< + * with open(self.filepath, 'a') as appender: + * appender.write(text) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_The_file_specified_for_the_text); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/file.pyx":34 + * if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + * with open(self.filepath, 'a') as appender: # <<<<<<<<<<<<<< + * appender.write(text) + * except UnicodeEncodeError as ue: + */ + __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/file.pyx":40 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/file.pyx":52 + * from Naked.toolshed.system import file_exists + * if not file_exists(self.filepath): + * raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") # <<<<<<<<<<<<<< + * import codecs + * import unicodedata + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_The_file_specified_for_the_text_2); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "lib/Naked/toolshed/c/file.pyx":56 + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + * with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: # <<<<<<<<<<<<<< + * appender.write(norm_text) + * except Exception as e: + */ + __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/file.pyx":60 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "lib/Naked/toolshed/c/file.pyx":74 + * try: + * import gzip + * if not self.filepath.endswith(".gz"): # <<<<<<<<<<<<<< + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_gz); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/file.pyx":76 + * if not self.filepath.endswith(".gz"): + * self.filepath = self.filepath + ".gz" + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(text) + * except UnicodeEncodeError as ue: + */ + __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "lib/Naked/toolshed/c/file.pyx":83 + * import codecs + * binary_data = codecs.encode(norm_text, "utf_8") + * with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: # <<<<<<<<<<<<<< + * gzip_writer.write(binary_data) + * except Exception as e: + */ + __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/file.pyx":87 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/file.pyx":98 + * def write(self, text): + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * except UnicodeEncodeError as ue: + */ + __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/file.pyx":104 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_3); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/file.pyx":115 + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_The_text_encoding_was_not_specif); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/file.pyx":117 + * raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: # <<<<<<<<<<<<<< + * f.write(text) + * except Exception as e: + */ + __pyx_tuple__15 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/file.pyx":121 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/file.pyx":131 + * def write_bin(self, binary_data): + * try: + * with open(self.filepath, 'wb') as bin_writer: # <<<<<<<<<<<<<< + * bin_writer.write(binary_data) + * except Exception as e: + */ + __pyx_tuple__17 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "lib/Naked/toolshed/c/file.pyx":135 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_4); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/file.pyx":148 + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + * try: + * with open(self.filepath, 'wt') as writer: # <<<<<<<<<<<<<< + * writer.write(text) + * return True + */ + __pyx_tuple__19 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "lib/Naked/toolshed/c/file.pyx":156 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * else: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_5); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "lib/Naked/toolshed/c/file.pyx":170 + * import os.path + * if not os.path.exists(self.filepath): + * with open(self.filepath, 'wb') as writer: # <<<<<<<<<<<<<< + * writer.write(file_data) + * return True + */ + __pyx_tuple__21 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "lib/Naked/toolshed/c/file.pyx":177 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_6); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "lib/Naked/toolshed/c/file.pyx":194 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_7); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/file.pyx":202 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_8); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "lib/Naked/toolshed/c/file.pyx":227 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_9); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "lib/Naked/toolshed/c/file.pyx":238 + * def read_bin(self): + * try: + * with open(self.filepath, 'rb') as bin_reader: # <<<<<<<<<<<<<< + * data = bin_reader.read() + * return data + */ + __pyx_tuple__26 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "lib/Naked/toolshed/c/file.pyx":243 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_10); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "lib/Naked/toolshed/c/file.pyx":255 + * try: + * if the_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_The_text_file_encoding_was_not_s); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "lib/Naked/toolshed/c/file.pyx":257 + * raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + * import codecs + * with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: # <<<<<<<<<<<<<< + * data = f.read() + * return data + */ + __pyx_tuple__30 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "lib/Naked/toolshed/c/file.pyx":262 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_11); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "lib/Naked/toolshed/c/file.pyx":276 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_12); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "lib/Naked/toolshed/c/file.pyx":288 + * try: + * if dev_spec_encoding == "": + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_The_text_file_encoding_was_not_s_2); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "lib/Naked/toolshed/c/file.pyx":290 + * raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + * import codecs + * with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: # <<<<<<<<<<<<<< + * data_list = [] + * for line in reader: + */ + __pyx_tuple__34 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__35 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "lib/Naked/toolshed/c/file.pyx":297 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "lib/Naked/toolshed/c/file.pyx":309 + * try: + * import codecs + * with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: # <<<<<<<<<<<<<< + * modified_text_list = [] + * for line in uni_reader: + */ + __pyx_tuple__37 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__38 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "lib/Naked/toolshed/c/file.pyx":318 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "lib/Naked/toolshed/c/file.pyx":332 + * try: + * import gzip + * with gzip.open(self.filepath, 'rb') as gzip_reader: # <<<<<<<<<<<<<< + * file_data = gzip_reader.read() + * if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + */ + __pyx_tuple__40 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_tuple__41 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + + /* "lib/Naked/toolshed/c/file.pyx":344 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_13); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "lib/Naked/toolshed/c/file.pyx":361 + * except IOError as ioe: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise ioe + * try: + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_14); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "lib/Naked/toolshed/c/file.pyx":370 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") # <<<<<<<<<<<<<< + * raise e + * finally: + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_15); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filepath); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filepath); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_tuple__49 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_file_exists, __pyx_n_s_appender, __pyx_n_s_ue, __pyx_n_s_e); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_append, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_tuple__51 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_file_exists, __pyx_n_s_codecs, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_appender, __pyx_n_s_e); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_append_utf8, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_tuple__53 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_compression_level, __pyx_n_s_gzip, __pyx_n_s_gzip_writer, __pyx_n_s_ue, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_codecs, __pyx_n_s_binary_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_gzip, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__55 = PyTuple_Pack(1, ((PyObject *)__pyx_int_6)); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + + /* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_writer, __pyx_n_s_ue, __pyx_n_s_e); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + __pyx_tuple__58 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_the_encoding, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_e); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write_as, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__60 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__13)); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + + /* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_binary_data, __pyx_n_s_bin_writer, __pyx_n_s_e); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write_bin, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + __pyx_tuple__63 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_os, __pyx_n_s_writer, __pyx_n_s_ue, __pyx_n_s_e); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_safe_write, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_file_data, __pyx_n_s_os, __pyx_n_s_writer, __pyx_n_s_e); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_safe_write_bin, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_tuple__67 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_text, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_ioe, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_write_utf8, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filepath); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_bin_reader, __pyx_n_s_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_bin, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_the_encoding, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_as, 252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_readlines, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_dev_spec_encoding, __pyx_n_s_codecs, __pyx_n_s_reader, __pyx_n_s_data_list, __pyx_n_s_line, __pyx_n_s_e); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_readlines_as, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_codecs, __pyx_n_s_uni_reader, __pyx_n_s_modified_text_list, __pyx_n_s_line, __pyx_n_s_unicodedata, __pyx_n_s_norm_line, __pyx_n_s_e); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_readlines_utf8, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_tuple__83 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_encoding, __pyx_n_s_gzip, __pyx_n_s_gzip_reader, __pyx_n_s_file_data, __pyx_n_s_codecs, __pyx_n_s_unicodedata, __pyx_n_s_norm_data, __pyx_n_s_e); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_gzip, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__85 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_system_default)); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + + /* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_ioe, __pyx_n_s_textstring, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_read_utf8, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initfile(void); /*proto*/ +PyMODINIT_FUNC initfile(void) +#else +PyMODINIT_FUNC PyInit_file(void); /*proto*/ +PyMODINIT_FUNC PyInit_file(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_file(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("file"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__file) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.file")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.file", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/file.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":6 + * + * import sys + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":12 + * # interface for all local file IO classes + * #------------------------------------------------------------------------------ + * class IO: # <<<<<<<<<<<<<< + * def __init__(self,filepath): + * self.filepath = filepath + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_IO, __pyx_n_s_IO, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_file, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/file.pyx":13 + * #------------------------------------------------------------------------------ + * class IO: + * def __init__(self,filepath): # <<<<<<<<<<<<<< + * self.filepath = filepath + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_2IO_1__init__, 0, __pyx_n_s_IO___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":12 + * # interface for all local file IO classes + * #------------------------------------------------------------------------------ + * class IO: # <<<<<<<<<<<<<< + * def __init__(self,filepath): + * self.filepath = filepath + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_IO, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":20 + * # writes data to local files + * #------------------------------------------------------------------------------ + * class FileWriter(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_FileWriter, __pyx_n_s_FileWriter, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_file, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/file.pyx":21 + * #------------------------------------------------------------------------------ + * class FileWriter(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_1__init__, 0, __pyx_n_s_FileWriter___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":29 + * # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + * #------------------------------------------------------------------------------ + * def append(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_3append, 0, __pyx_n_s_FileWriter_append, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_append, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":48 + * # Tests: test_IO.py :: test_file_utf8_readwrite_append + * #------------------------------------------------------------------------------ + * def append_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.system import file_exists + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_5append_utf8, 0, __pyx_n_s_FileWriter_append_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_append_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":71 + * # test_file_gzip_utf8_readwrite_explicit_decode + * #------------------------------------------------------------------------------ + * def gzip(self, text, compression_level=6): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_7gzip, 0, __pyx_n_s_FileWriter_gzip, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__55); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_gzip, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":96 + * # test_file_utf8_write_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write(self, text): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wt') as writer: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_9write, 0, __pyx_n_s_FileWriter_write, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":112 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas + * #------------------------------------------------------------------------------ + * def write_as(self, text, the_encoding=""): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": #if the developer did not include the encoding type, raise an exception + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_11write_as, 0, __pyx_n_s_FileWriter_write_as, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__60); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_as, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":129 + * # Tests: test_IO.py :: test_file_bin_readwrite + * #------------------------------------------------------------------------------ + * def write_bin(self, binary_data): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'wb') as bin_writer: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_13write_bin, 0, __pyx_n_s_FileWriter_write_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_bin, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":144 + * # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + * #------------------------------------------------------------------------------ + * def safe_write(self, text): # <<<<<<<<<<<<<< + * import os.path + * if not os.path.exists(self.filepath): # if the file does not exist, then can write + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_15safe_write, 0, __pyx_n_s_FileWriter_safe_write, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_safe_write, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":166 + * # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + * #------------------------------------------------------------------------------ + * def safe_write_bin(self, file_data): # <<<<<<<<<<<<<< + * try: + * import os.path + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_17safe_write_bin, 0, __pyx_n_s_FileWriter_safe_write_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_safe_write_bin, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":188 + * # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + * #------------------------------------------------------------------------------ + * def write_utf8(self, text): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileWriter_19write_utf8, 0, __pyx_n_s_FileWriter_write_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_write_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":20 + * # writes data to local files + * #------------------------------------------------------------------------------ + * class FileWriter(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FileWriter, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileWriter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":212 + * # filename assigned in constructor (inherited from IO class interface) + * #------------------------------------------------------------------------------ + * class FileReader(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_FileReader, __pyx_n_s_FileReader, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_file, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/file.pyx":213 + * #------------------------------------------------------------------------------ + * class FileReader(IO): + * def __init__(self, filepath): # <<<<<<<<<<<<<< + * IO.__init__(self, filepath) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_1__init__, 0, __pyx_n_s_FileReader___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":222 + * # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + * #------------------------------------------------------------------------------ + * def read(self): # <<<<<<<<<<<<<< + * try: + * return self.read_utf8() #reads everything as unicode in utf8 encoding + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_3read, 0, __pyx_n_s_FileReader_read, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":236 + * # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + * #------------------------------------------------------------------------------ + * def read_bin(self): # <<<<<<<<<<<<<< + * try: + * with open(self.filepath, 'rb') as bin_reader: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_5read_bin, 0, __pyx_n_s_FileReader_read_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_bin, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":252 + * # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + * #------------------------------------------------------------------------------ + * def read_as(self, the_encoding): # <<<<<<<<<<<<<< + * try: + * if the_encoding == "": + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_7read_as, 0, __pyx_n_s_FileReader_read_as, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_as, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":271 + * # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + * #------------------------------------------------------------------------------ + * def readlines(self): # <<<<<<<<<<<<<< + * try: + * return self.readlines_utf8() # read as utf8 encoded file + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_9readlines, 0, __pyx_n_s_FileReader_readlines, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_readlines, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":285 + * # Tests: test_IO.py :: + * #------------------------------------------------------------------------------ + * def readlines_as(self, dev_spec_encoding): # <<<<<<<<<<<<<< + * try: + * if dev_spec_encoding == "": + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_11readlines_as, 0, __pyx_n_s_FileReader_readlines_as, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_readlines_as, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":306 + * # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + * #------------------------------------------------------------------------------ + * def readlines_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_13readlines_utf8, 0, __pyx_n_s_FileReader_readlines_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_readlines_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":329 + * # test_file_read_gzip_missing_file + * #------------------------------------------------------------------------------ + * def read_gzip(self, encoding="system_default"): # <<<<<<<<<<<<<< + * try: + * import gzip + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_15read_gzip, 0, __pyx_n_s_FileReader_read_gzip, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__85); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_gzip, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":355 + * # test_file_read_utf8_missing_file + * #------------------------------------------------------------------------------ + * def read_utf8(self): # <<<<<<<<<<<<<< + * try: + * import codecs + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_4file_10FileReader_17read_utf8, 0, __pyx_n_s_FileReader_read_utf8, NULL, __pyx_n_s_lib_Naked_toolshed_c_file, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_utf8, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":212 + * # filename assigned in constructor (inherited from IO class interface) + * #------------------------------------------------------------------------------ + * class FileReader(IO): # <<<<<<<<<<<<<< + * def __init__(self, filepath): + * IO.__init__(self, filepath) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FileReader, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileReader, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/file.pyx":376 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/file.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.file", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.file"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; +#else + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); +#endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.pyx new file mode 100644 index 00000000..545948f7 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/file.pyx @@ -0,0 +1,377 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ IO class ] +# interface for all local file IO classes +#------------------------------------------------------------------------------ +class IO: + def __init__(self,filepath): + self.filepath = filepath + +#------------------------------------------------------------------------------ +# [ FileWriter class ] +# writes data to local files +#------------------------------------------------------------------------------ +class FileWriter(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ append method ] + # Universal text file writer that appends to existing file using system default text encoding or utf-8 if throws unicode error + # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + #------------------------------------------------------------------------------ + def append(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + with open(self.filepath, 'a') as appender: + appender.write(text) + except UnicodeEncodeError as ue: + self.append_utf8(text) #try writing as utf-8 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ append_utf8 method ] + # Text writer that appends text to existing file with utf-8 encoding + # Tests: test_IO.py :: test_file_utf8_readwrite_append + #------------------------------------------------------------------------------ + def append_utf8(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + import codecs + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + appender.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ gzip method (writer) ] + # writes data to gzip compressed file + # Note: adds .gz extension to filename if user did not specify it in the FileWriter class constructor + # Note: uses compresslevel = 6 as default to balance speed and compression level (which in general is not significantly less than 9) + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_gzip_utf8_readwrite_explicit_decode + #------------------------------------------------------------------------------ + def gzip(self, text, compression_level=6): + try: + import gzip + if not self.filepath.endswith(".gz"): + self.filepath = self.filepath + ".gz" + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(text) + except UnicodeEncodeError as ue: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + import codecs + binary_data = codecs.encode(norm_text, "utf_8") + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write method ] + # Universal text file writer that writes by system default or utf-8 encoded unicode if throws UnicdeEncodeError + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_ascii_readwrite_missing_file, + # test_file_utf8_write_raises_unicodeerror + #------------------------------------------------------------------------------ + def write(self, text): + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + except UnicodeEncodeError as ue: + self.write_utf8(text) # attempt to write with utf-8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_as method ] + # text file writer that uses developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas + #------------------------------------------------------------------------------ + def write_as(self, text, the_encoding=""): + try: + if the_encoding == "": #if the developer did not include the encoding type, raise an exception + raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + f.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_bin method ] + # binary data file writer + # Tests: test_IO.py :: test_file_bin_readwrite + #------------------------------------------------------------------------------ + def write_bin(self, binary_data): + try: + with open(self.filepath, 'wb') as bin_writer: + bin_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ safe_write method ] (boolean) + # Universal text file writer (writes in default encoding unless throws unicode error) that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + #------------------------------------------------------------------------------ + def safe_write(self, text): + import os.path + if not os.path.exists(self.filepath): # if the file does not exist, then can write + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + return True + except UnicodeEncodeError as ue: + self.write_utf8(text) + return True + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + raise e + else: + return False # if file exists, do not write and return False + + #------------------------------------------------------------------------------ + # [ safe_write_bin method ] + # Binary data file writer that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + #------------------------------------------------------------------------------ + def safe_write_bin(self, file_data): + try: + import os.path + if not os.path.exists(self.filepath): + with open(self.filepath, 'wb') as writer: + writer.write(file_data) + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ write_utf8 method ] + # Text file writer with explicit UTF-8 text encoding + # uses filepath from class constructor + # requires text to passed as a method parameter + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + #------------------------------------------------------------------------------ + def write_utf8(self, text): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='w') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + f.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + +#------------------------------------------------------------------------------ +# [ FileReader class ] +# reads data from local files +# filename assigned in constructor (inherited from IO class interface) +#------------------------------------------------------------------------------ +class FileReader(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ read method ] (string) + # Universal text file reader that will read utf-8 encoded unicode or non-unicode text as utf-8 + # returns string or unicode (py3 = string for unicode and non-unicode, py2 = str for non-unicode, unicode for unicode) + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + #------------------------------------------------------------------------------ + def read(self): + try: + return self.read_utf8() #reads everything as unicode in utf8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_bin method ] (binary byte string) + # Universal binary data file reader + # returns file contents in binary mode as binary byte strings + # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + #------------------------------------------------------------------------------ + def read_bin(self): + try: + with open(self.filepath, 'rb') as bin_reader: + data = bin_reader.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_as method ] (string with developer specified text encoding) + # Text file reader with developer specified text encoding + # returns file contents in developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + #------------------------------------------------------------------------------ + def read_as(self, the_encoding): + try: + if the_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + data = f.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines method ] (list of strings) + # Read text from file line by line, uses utf8 encoding by default + # returns list of utf8 encoded file lines as strings + # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + #------------------------------------------------------------------------------ + def readlines(self): + try: + return self.readlines_utf8() # read as utf8 encoded file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_as method ] (list of developer specified encoded strings) + # Read lines from file with developer specified text encoding + # Returns a list of developer specified encoded lines from the file + # Tests: test_IO.py :: + #------------------------------------------------------------------------------ + def readlines_as(self, dev_spec_encoding): + try: + if dev_spec_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + import codecs + with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + data_list = [] + for line in reader: + data_list.append(line) + return data_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_utf8 method ] (list of utf-8 encoded strings) + # Read text from unicode file by line + # Returns list of file unicode text lines as unicode strings + # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + #------------------------------------------------------------------------------ + def readlines_utf8(self): + try: + import codecs + with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + modified_text_list = [] + for line in uni_reader: + import unicodedata + norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + modified_text_list.append(norm_line) + return modified_text_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + raise e + + #------------------------------------------------------------------------------ + # [ read_gzip ] (byte string) + # reads data from a gzip compressed file + # returns the decompressed binary data from the file + # Note: if decompressing unicode file, set encoding="utf-8" + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_read_gzip_missing_file + #------------------------------------------------------------------------------ + def read_gzip(self, encoding="system_default"): + try: + import gzip + with gzip.open(self.filepath, 'rb') as gzip_reader: + file_data = gzip_reader.read() + if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + import codecs + file_data = codecs.decode(file_data, "utf-8") + import unicodedata + norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + return norm_data + else: + return file_data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_utf8 method ] (string) + # read data from a file with explicit UTF-8 encoding + # uses filepath from class constructor + # returns a unicode string containing the file data (unicode in py2, str in py3) + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_append, + # test_file_read_utf8_missing_file + #------------------------------------------------------------------------------ + def read_utf8(self): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='r') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + textstring = f.read() + import unicodedata + norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + return norm_text + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.c new file mode 100644 index 00000000..e34bfc1e --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.c @@ -0,0 +1,4232 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:14 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__ink +#define __PYX_HAVE_API__lib__Naked__toolshed__c__ink +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "ink.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define Pyx_PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.ink' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.ink" +int __pyx_module_is_main_lib__Naked__toolshed__c__ink = 0; + +/* Implementation of 'lib.Naked.toolshed.c.ink' */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_template_text, PyObject *__pyx_v_open_delimiter, PyObject *__pyx_v_close_delimiter, PyObject *__pyx_v_escape_regex); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_2_make_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template_text, PyObject *__pyx_v_escape_regex); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_4_escape_regex_special_chars(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_test_escape_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template, PyObject *__pyx_v_key, PyObject *__pyx_v_html_entities); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer_2render(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_[] = "{{"; +static char __pyx_k__2[] = "}}"; +static char __pyx_k__3[] = "(.*?)"; +static char __pyx_k_re[] = "re"; +static char __pyx_k_cls[] = "cls"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_new[] = "__new__"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_cdel[] = "cdel"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_odel[] = "odel"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_escape[] = "escape"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_render[] = "render"; +static char __pyx_k_findall[] = "findall"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_replace[] = "replace"; +static char __pyx_k_varlist[] = "varlist"; +static char __pyx_k_Renderer[] = "Renderer"; +static char __pyx_k_Template[] = "Template"; +static char __pyx_k_key_dict[] = "key_dict"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_template[] = "template"; +static char __pyx_k_var_list[] = "var_list"; +static char __pyx_k_match_pat[] = "match_pat"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_local_cdel[] = "local_cdel"; +static char __pyx_k_local_dict[] = "local_dict"; +static char __pyx_k_local_odel[] = "local_odel"; +static char __pyx_k_escape_regex[] = "escape_regex"; +static char __pyx_k_html_entities[] = "html_entities"; +static char __pyx_k_local_htmlent[] = "local_htmlent"; +static char __pyx_k_local_varlist[] = "local_varlist"; +static char __pyx_k_make_var_list[] = "_make_var_list"; +static char __pyx_k_template_text[] = "template_text"; +static char __pyx_k_Template___new[] = "Template.__new__"; +static char __pyx_k_local_template[] = "local_template"; +static char __pyx_k_open_delimiter[] = "open_delimiter"; +static char __pyx_k_open_match_pat[] = "open_match_pat"; +static char __pyx_k_replace_string[] = "replace_string"; +static char __pyx_k_Renderer___init[] = "Renderer.__init__"; +static char __pyx_k_Renderer_render[] = "Renderer.render"; +static char __pyx_k_close_delimiter[] = "close_delimiter"; +static char __pyx_k_close_match_pat[] = "close_match_pat"; +static char __pyx_k_xml_sax_saxutils[] = "xml.sax.saxutils"; +static char __pyx_k_test_escape_string[] = "test_escape_string"; +static char __pyx_k_Template__make_var_list[] = "Template._make_var_list"; +static char __pyx_k_lib_Naked_toolshed_c_ink[] = "lib.Naked.toolshed.c.ink"; +static char __pyx_k_escape_regex_special_chars[] = "_escape_regex_special_chars"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/ink.pyx"; +static char __pyx_k_Template__escape_regex_special_c[] = "Template._escape_regex_special_chars"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_Renderer; +static PyObject *__pyx_n_s_Renderer___init; +static PyObject *__pyx_n_s_Renderer_render; +static PyObject *__pyx_n_s_Template; +static PyObject *__pyx_n_s_Template___new; +static PyObject *__pyx_n_s_Template__escape_regex_special_c; +static PyObject *__pyx_n_s_Template__make_var_list; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s_cdel; +static PyObject *__pyx_n_s_close_delimiter; +static PyObject *__pyx_n_s_close_match_pat; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_escape; +static PyObject *__pyx_n_s_escape_regex; +static PyObject *__pyx_n_s_escape_regex_special_chars; +static PyObject *__pyx_n_s_findall; +static PyObject *__pyx_n_s_html_entities; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_key_dict; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_ink; +static PyObject *__pyx_n_s_local_cdel; +static PyObject *__pyx_n_s_local_dict; +static PyObject *__pyx_n_s_local_htmlent; +static PyObject *__pyx_n_s_local_odel; +static PyObject *__pyx_n_s_local_template; +static PyObject *__pyx_n_s_local_varlist; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_var_list; +static PyObject *__pyx_n_s_match_pat; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_odel; +static PyObject *__pyx_n_s_open_delimiter; +static PyObject *__pyx_n_s_open_match_pat; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_re; +static PyObject *__pyx_n_s_render; +static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_replace_string; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_template; +static PyObject *__pyx_n_s_template_text; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_escape_string; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_var_list; +static PyObject *__pyx_n_s_varlist; +static PyObject *__pyx_n_s_xml_sax_saxutils; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__16; + +/* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_template_text = 0; + PyObject *__pyx_v_open_delimiter = 0; + PyObject *__pyx_v_close_delimiter = 0; + PyObject *__pyx_v_escape_regex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_template_text,&__pyx_n_s_open_delimiter,&__pyx_n_s_close_delimiter,&__pyx_n_s_escape_regex,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[3] = ((PyObject *)((PyObject*)__pyx_kp_s__2)); + values[4] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_open_delimiter); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_close_delimiter); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_escape_regex); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_template_text = values[1]; + __pyx_v_open_delimiter = values[2]; + __pyx_v_close_delimiter = values[3]; + __pyx_v_escape_regex = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template___new__(__pyx_self, __pyx_v_cls, __pyx_v_template_text, __pyx_v_open_delimiter, __pyx_v_close_delimiter, __pyx_v_escape_regex); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_template_text, PyObject *__pyx_v_open_delimiter, PyObject *__pyx_v_close_delimiter, PyObject *__pyx_v_escape_regex) { + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":27 + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) # <<<<<<<<<<<<<< + * obj.odel = open_delimiter + * obj.cdel = close_delimiter + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_template_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_template_text); + __Pyx_GIVEREF(__pyx_v_template_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":28 + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter # <<<<<<<<<<<<<< + * obj.cdel = close_delimiter + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_odel, __pyx_v_open_delimiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":29 + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + * obj.cdel = close_delimiter # <<<<<<<<<<<<<< + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + * return obj + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_cdel, __pyx_v_close_delimiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":30 + * obj.odel = open_delimiter + * obj.cdel = close_delimiter + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list # <<<<<<<<<<<<<< + * return obj + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_make_var_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_template_text); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_template_text); + __Pyx_GIVEREF(__pyx_v_template_text); + __Pyx_INCREF(__pyx_v_escape_regex); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_escape_regex); + __Pyx_GIVEREF(__pyx_v_escape_regex); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_varlist, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":31 + * obj.cdel = close_delimiter + * obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + * return obj # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list = {__Pyx_NAMESTR("_make_var_list"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_template_text = 0; + PyObject *__pyx_v_escape_regex = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_make_var_list (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_template_text,&__pyx_n_s_escape_regex,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_make_var_list", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_escape_regex); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_make_var_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_template_text = values[1]; + __pyx_v_escape_regex = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_make_var_list", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._make_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_2_make_var_list(__pyx_self, __pyx_v_self, __pyx_v_template_text, __pyx_v_escape_regex); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_2_make_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template_text, PyObject *__pyx_v_escape_regex) { + PyObject *__pyx_v_open_match_pat = NULL; + PyObject *__pyx_v_close_match_pat = NULL; + PyObject *__pyx_v_match_pat = NULL; + PyObject *__pyx_v_var_list = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_make_var_list", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":39 + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): + * if escape_regex: # <<<<<<<<<<<<<< + * open_match_pat = self._escape_regex_special_chars(self.odel) + * close_match_pat = self._escape_regex_special_chars(self.cdel) + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_escape_regex); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "lib/Naked/toolshed/c/ink.pyx":40 + * def _make_var_list(self, template_text, escape_regex=False): + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) # <<<<<<<<<<<<<< + * close_match_pat = self._escape_regex_special_chars(self.cdel) + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_escape_regex_special_chars); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_odel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_open_match_pat = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":41 + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + * close_match_pat = self._escape_regex_special_chars(self.cdel) # <<<<<<<<<<<<<< + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_escape_regex_special_chars); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_close_match_pat = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":42 + * open_match_pat = self._escape_regex_special_chars(self.odel) + * close_match_pat = self._escape_regex_special_chars(self.cdel) + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters # <<<<<<<<<<<<<< + * else: + * match_pat = self.odel + r'(.*?)' + self.cdel + */ + __pyx_t_4 = PyNumber_Add(__pyx_v_open_match_pat, __pyx_kp_s__3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_close_match_pat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_match_pat = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/ink.pyx":44 + * match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + * else: + * match_pat = self.odel + r'(.*?)' + self.cdel # <<<<<<<<<<<<<< + * var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + * return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_odel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_match_pat = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/ink.pyx":45 + * else: + * match_pat = self.odel + r'(.*?)' + self.cdel + * var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) # <<<<<<<<<<<<<< + * return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_findall); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_match_pat); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match_pat); + __Pyx_GIVEREF(__pyx_v_match_pat); + __Pyx_INCREF(__pyx_v_template_text); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_template_text); + __Pyx_GIVEREF(__pyx_v_template_text); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_var_list = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":46 + * match_pat = self.odel + r'(.*?)' + self.cdel + * var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + * return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_var_list); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_var_list); + __Pyx_GIVEREF(__pyx_v_var_list); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._make_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_open_match_pat); + __Pyx_XDECREF(__pyx_v_close_match_pat); + __Pyx_XDECREF(__pyx_v_match_pat); + __Pyx_XDECREF(__pyx_v_var_list); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars = {__Pyx_NAMESTR("_escape_regex_special_chars"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_test_escape_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_escape_regex_special_chars (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_test_escape_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test_escape_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_escape_regex_special_chars", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_escape_regex_special_chars") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_test_escape_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_escape_regex_special_chars", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._escape_regex_special_chars", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_4_escape_regex_special_chars(__pyx_self, __pyx_v_self, __pyx_v_test_escape_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Template_4_escape_regex_special_chars(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_test_escape_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_escape_regex_special_chars", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":54 + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): + * return re.escape(test_escape_string) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_escape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_test_escape_string); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_test_escape_string); + __Pyx_GIVEREF(__pyx_v_test_escape_string); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Template._escape_regex_special_chars", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_template = 0; + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_html_entities = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_template,&__pyx_n_s_key,&__pyx_n_s_html_entities,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_html_entities); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_template = values[1]; + __pyx_v_key = values[2]; + __pyx_v_html_entities = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer___init__(__pyx_self, __pyx_v_self, __pyx_v_template, __pyx_v_key, __pyx_v_html_entities); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_template, PyObject *__pyx_v_key, PyObject *__pyx_v_html_entities) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":69 + * class Renderer: + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel # <<<<<<<<<<<<<< + * self.cdel = template.cdel + * self.template = template + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_template, __pyx_n_s_odel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_odel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":70 + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel + * self.cdel = template.cdel # <<<<<<<<<<<<<< + * self.template = template + * self.html_entities = html_entities + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_template, __pyx_n_s_cdel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cdel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":71 + * self.odel = template.odel + * self.cdel = template.cdel + * self.template = template # <<<<<<<<<<<<<< + * self.html_entities = html_entities + * self.key_dict = key + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_template, __pyx_v_template) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":72 + * self.cdel = template.cdel + * self.template = template + * self.html_entities = html_entities # <<<<<<<<<<<<<< + * self.key_dict = key + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_html_entities, __pyx_v_html_entities) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":73 + * self.template = template + * self.html_entities = html_entities + * self.key_dict = key # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_key_dict, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render = {__Pyx_NAMESTR("render"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("render (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer_2render(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_3ink_8Renderer_2render(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_local_dict = NULL; + PyObject *__pyx_v_local_template = NULL; + PyObject *__pyx_v_local_varlist = NULL; + PyObject *__pyx_v_local_odel = NULL; + PyObject *__pyx_v_local_cdel = NULL; + PyObject *__pyx_v_local_htmlent = NULL; + PyObject *__pyx_v_escape = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_replace_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("render", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":82 + * def render(self): + * # make local variables for the loop below (faster) + * local_dict = self.key_dict # <<<<<<<<<<<<<< + * local_template = self.template + * local_varlist = self.template.varlist + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_local_dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":83 + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + * local_template = self.template # <<<<<<<<<<<<<< + * local_varlist = self.template.varlist + * local_odel = self.odel + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_template); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_local_template = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":84 + * local_dict = self.key_dict + * local_template = self.template + * local_varlist = self.template.varlist # <<<<<<<<<<<<<< + * local_odel = self.odel + * local_cdel = self.cdel + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_template); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_varlist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_local_varlist = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":85 + * local_template = self.template + * local_varlist = self.template.varlist + * local_odel = self.odel # <<<<<<<<<<<<<< + * local_cdel = self.cdel + * local_htmlent = self.html_entities + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_odel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_local_odel = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":86 + * local_varlist = self.template.varlist + * local_odel = self.odel + * local_cdel = self.cdel # <<<<<<<<<<<<<< + * local_htmlent = self.html_entities + * if local_htmlent: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cdel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_local_cdel = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":87 + * local_odel = self.odel + * local_cdel = self.cdel + * local_htmlent = self.html_entities # <<<<<<<<<<<<<< + * if local_htmlent: + * from xml.sax.saxutils import escape #from Python std lib + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_html_entities); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_local_htmlent = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":88 + * local_cdel = self.cdel + * local_htmlent = self.html_entities + * if local_htmlent: # <<<<<<<<<<<<<< + * from xml.sax.saxutils import escape #from Python std lib + * for key in local_dict: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_local_htmlent); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/ink.pyx":89 + * local_htmlent = self.html_entities + * if local_htmlent: + * from xml.sax.saxutils import escape #from Python std lib # <<<<<<<<<<<<<< + * for key in local_dict: + * if key in local_varlist: + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_escape); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_escape); + __Pyx_GIVEREF(__pyx_n_s_escape); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_xml_sax_saxutils, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_escape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_escape = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/ink.pyx":90 + * if local_htmlent: + * from xml.sax.saxutils import escape #from Python std lib + * for key in local_dict: # <<<<<<<<<<<<<< + * if key in local_varlist: + * value = local_dict[key] + */ + if (PyList_CheckExact(__pyx_v_local_dict) || PyTuple_CheckExact(__pyx_v_local_dict)) { + __pyx_t_1 = __pyx_v_local_dict; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_local_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":91 + * from xml.sax.saxutils import escape #from Python std lib + * for key in local_dict: + * if key in local_varlist: # <<<<<<<<<<<<<< + * value = local_dict[key] + * replace_string = local_odel + key + local_cdel + */ + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_local_varlist, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = (__pyx_t_3 != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/ink.pyx":92 + * for key in local_dict: + * if key in local_varlist: + * value = local_dict[key] # <<<<<<<<<<<<<< + * replace_string = local_odel + key + local_cdel + * if local_htmlent: + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_local_dict, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":93 + * if key in local_varlist: + * value = local_dict[key] + * replace_string = local_odel + key + local_cdel # <<<<<<<<<<<<<< + * if local_htmlent: + * value = escape(value) #xml.sax.saxutils function + */ + __pyx_t_2 = PyNumber_Add(__pyx_v_local_odel, __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_v_local_cdel); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_replace_string, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":94 + * value = local_dict[key] + * replace_string = local_odel + key + local_cdel + * if local_htmlent: # <<<<<<<<<<<<<< + * value = escape(value) #xml.sax.saxutils function + * local_template = local_template.replace(replace_string, value) + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_local_htmlent); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/ink.pyx":95 + * replace_string = local_odel + key + local_cdel + * if local_htmlent: + * value = escape(value) #xml.sax.saxutils function # <<<<<<<<<<<<<< + * local_template = local_template.replace(replace_string, value) + * return local_template + */ + if (unlikely(!__pyx_v_escape)) { __Pyx_RaiseUnboundLocalError("escape"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_escape, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L7; + } + __pyx_L7:; + + /* "lib/Naked/toolshed/c/ink.pyx":96 + * if local_htmlent: + * value = escape(value) #xml.sax.saxutils function + * local_template = local_template.replace(replace_string, value) # <<<<<<<<<<<<<< + * return local_template + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_local_template, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_replace_string); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_replace_string); + __Pyx_GIVEREF(__pyx_v_replace_string); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_local_template, __pyx_t_8); + __pyx_t_8 = 0; + goto __pyx_L6; + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":97 + * value = escape(value) #xml.sax.saxutils function + * local_template = local_template.replace(replace_string, value) + * return local_template # <<<<<<<<<<<<<< + * + * ##TODO : multiple file render method? + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_local_template); + __pyx_r = __pyx_v_local_template; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.ink.Renderer.render", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_local_dict); + __Pyx_XDECREF(__pyx_v_local_template); + __Pyx_XDECREF(__pyx_v_local_varlist); + __Pyx_XDECREF(__pyx_v_local_odel); + __Pyx_XDECREF(__pyx_v_local_cdel); + __Pyx_XDECREF(__pyx_v_local_htmlent); + __Pyx_XDECREF(__pyx_v_escape); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_replace_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("ink"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_Renderer, __pyx_k_Renderer, sizeof(__pyx_k_Renderer), 0, 0, 1, 1}, + {&__pyx_n_s_Renderer___init, __pyx_k_Renderer___init, sizeof(__pyx_k_Renderer___init), 0, 0, 1, 1}, + {&__pyx_n_s_Renderer_render, __pyx_k_Renderer_render, sizeof(__pyx_k_Renderer_render), 0, 0, 1, 1}, + {&__pyx_n_s_Template, __pyx_k_Template, sizeof(__pyx_k_Template), 0, 0, 1, 1}, + {&__pyx_n_s_Template___new, __pyx_k_Template___new, sizeof(__pyx_k_Template___new), 0, 0, 1, 1}, + {&__pyx_n_s_Template__escape_regex_special_c, __pyx_k_Template__escape_regex_special_c, sizeof(__pyx_k_Template__escape_regex_special_c), 0, 0, 1, 1}, + {&__pyx_n_s_Template__make_var_list, __pyx_k_Template__make_var_list, sizeof(__pyx_k_Template__make_var_list), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s_cdel, __pyx_k_cdel, sizeof(__pyx_k_cdel), 0, 0, 1, 1}, + {&__pyx_n_s_close_delimiter, __pyx_k_close_delimiter, sizeof(__pyx_k_close_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_close_match_pat, __pyx_k_close_match_pat, sizeof(__pyx_k_close_match_pat), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_escape, __pyx_k_escape, sizeof(__pyx_k_escape), 0, 0, 1, 1}, + {&__pyx_n_s_escape_regex, __pyx_k_escape_regex, sizeof(__pyx_k_escape_regex), 0, 0, 1, 1}, + {&__pyx_n_s_escape_regex_special_chars, __pyx_k_escape_regex_special_chars, sizeof(__pyx_k_escape_regex_special_chars), 0, 0, 1, 1}, + {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1}, + {&__pyx_n_s_html_entities, __pyx_k_html_entities, sizeof(__pyx_k_html_entities), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_key_dict, __pyx_k_key_dict, sizeof(__pyx_k_key_dict), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_ink, __pyx_k_lib_Naked_toolshed_c_ink, sizeof(__pyx_k_lib_Naked_toolshed_c_ink), 0, 0, 1, 1}, + {&__pyx_n_s_local_cdel, __pyx_k_local_cdel, sizeof(__pyx_k_local_cdel), 0, 0, 1, 1}, + {&__pyx_n_s_local_dict, __pyx_k_local_dict, sizeof(__pyx_k_local_dict), 0, 0, 1, 1}, + {&__pyx_n_s_local_htmlent, __pyx_k_local_htmlent, sizeof(__pyx_k_local_htmlent), 0, 0, 1, 1}, + {&__pyx_n_s_local_odel, __pyx_k_local_odel, sizeof(__pyx_k_local_odel), 0, 0, 1, 1}, + {&__pyx_n_s_local_template, __pyx_k_local_template, sizeof(__pyx_k_local_template), 0, 0, 1, 1}, + {&__pyx_n_s_local_varlist, __pyx_k_local_varlist, sizeof(__pyx_k_local_varlist), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_var_list, __pyx_k_make_var_list, sizeof(__pyx_k_make_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_match_pat, __pyx_k_match_pat, sizeof(__pyx_k_match_pat), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_odel, __pyx_k_odel, sizeof(__pyx_k_odel), 0, 0, 1, 1}, + {&__pyx_n_s_open_delimiter, __pyx_k_open_delimiter, sizeof(__pyx_k_open_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_open_match_pat, __pyx_k_open_match_pat, sizeof(__pyx_k_open_match_pat), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1}, + {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_replace_string, __pyx_k_replace_string, sizeof(__pyx_k_replace_string), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1}, + {&__pyx_n_s_template_text, __pyx_k_template_text, sizeof(__pyx_k_template_text), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_escape_string, __pyx_k_test_escape_string, sizeof(__pyx_k_test_escape_string), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_var_list, __pyx_k_var_list, sizeof(__pyx_k_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_varlist, __pyx_k_varlist, sizeof(__pyx_k_varlist), 0, 0, 1, 1}, + {&__pyx_n_s_xml_sax_saxutils, __pyx_k_xml_sax_saxutils, sizeof(__pyx_k_xml_sax_saxutils), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_template_text, __pyx_n_s_open_delimiter, __pyx_n_s_close_delimiter, __pyx_n_s_escape_regex, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__6 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject*)__pyx_kp_s__2), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_template_text, __pyx_n_s_escape_regex, __pyx_n_s_open_match_pat, __pyx_n_s_close_match_pat, __pyx_n_s_match_pat, __pyx_n_s_var_list); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_var_list, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__9 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_test_escape_string); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_escape_regex_special_chars, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_template, __pyx_n_s_key, __pyx_n_s_html_entities); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + __pyx_tuple__15 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_local_dict, __pyx_n_s_local_template, __pyx_n_s_local_varlist, __pyx_n_s_local_odel, __pyx_n_s_local_cdel, __pyx_n_s_local_htmlent, __pyx_n_s_escape, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_replace_string); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_render, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initink(void); /*proto*/ +PyMODINIT_FUNC initink(void) +#else +PyMODINIT_FUNC PyInit_ink(void); /*proto*/ +PyMODINIT_FUNC PyInit_ink(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_ink(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ink"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__ink) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.ink")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.ink", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/ink.pyx":11 + * # MIT License + * #------------------------------------------------------------------------------ + * import re # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":25 + * # `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it + * #------------------------------------------------------------------------------ + * class Template(str): # <<<<<<<<<<<<<< + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type)))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Template, __pyx_n_s_Template, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/ink.pyx":26 + * #------------------------------------------------------------------------------ + * class Template(str): + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): # <<<<<<<<<<<<<< + * obj = str.__new__(cls, template_text) + * obj.odel = open_delimiter + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Template___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__6); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":38 + * # Returns a list of the variable names as strings + * #------------------------------------------------------------------------------ + * def _make_var_list(self, template_text, escape_regex=False): # <<<<<<<<<<<<<< + * if escape_regex: + * open_match_pat = self._escape_regex_special_chars(self.odel) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_3_make_var_list, 0, __pyx_n_s_Template__make_var_list, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__9); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_make_var_list, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":53 + * # Returns a string with the escaped character modifications + * #------------------------------------------------------------------------------ + * def _escape_regex_special_chars(self, test_escape_string): # <<<<<<<<<<<<<< + * return re.escape(test_escape_string) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Template_5_escape_regex_special_chars, 0, __pyx_n_s_Template__escape_regex_special_c, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_escape_regex_special_chars, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":25 + * # `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it + * #------------------------------------------------------------------------------ + * class Template(str): # <<<<<<<<<<<<<< + * def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + * obj = str.__new__(cls, template_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Template, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Template, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":67 + * #------------------------------------------------------------------------------ + * + * class Renderer: # <<<<<<<<<<<<<< + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel + */ + __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Renderer, __pyx_n_s_Renderer, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/ink.pyx":68 + * + * class Renderer: + * def __init__(self, template, key, html_entities=False): # <<<<<<<<<<<<<< + * self.odel = template.odel + * self.cdel = template.cdel + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_1__init__, 0, __pyx_n_s_Renderer___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__14); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":80 + * # returns the rendered template as a string + * #------------------------------------------------------------------------------ + * def render(self): # <<<<<<<<<<<<<< + * # make local variables for the loop below (faster) + * local_dict = self.key_dict + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_3ink_8Renderer_3render, 0, __pyx_n_s_Renderer_render, NULL, __pyx_n_s_lib_Naked_toolshed_c_ink, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_render, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":67 + * #------------------------------------------------------------------------------ + * + * class Renderer: # <<<<<<<<<<<<<< + * def __init__(self, template, key, html_entities=False): + * self.odel = template.odel + */ + __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Renderer, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Renderer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/ink.pyx":102 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # template = Template("This is a of the {{test}} of the {{document}} {{type}} and more of the {{test}} {{document}} {{type}}") + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/ink.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.ink", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.ink"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.pyx new file mode 100644 index 00000000..2e9934ec --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/ink.pyx @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +#------------------------------------------------------------------------------ +# The Ink Templating System +# A lightweight, fast, flexible text templating system +# Copyright 2014 Christopher Simpkins +# MIT License +#------------------------------------------------------------------------------ +import re + +#------------------------------------------------------------------------------ +# Template class +# A template string class that is inherited from Python str +# Includes metadata about the template: +# odel = opening delimiter +# cdel = closing delimiter +# varlist = inclusive list of all variables in the template text (parsed in constructor) +# Delimiters: +# default = {{variable}} +# assign new opening and closing delimiters as parameters when you make a new Template instance +# `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it +#------------------------------------------------------------------------------ +class Template(str): + def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + obj = str.__new__(cls, template_text) + obj.odel = open_delimiter + obj.cdel = close_delimiter + obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + return obj + + #------------------------------------------------------------------------------ + # [ _make_var_list method ] (list of strings) + # Private method that parses the template string for all variables that match the delimiter pattern + # Returns a list of the variable names as strings + #------------------------------------------------------------------------------ + def _make_var_list(self, template_text, escape_regex=False): + if escape_regex: + open_match_pat = self._escape_regex_special_chars(self.odel) + close_match_pat = self._escape_regex_special_chars(self.cdel) + match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + else: + match_pat = self.odel + r'(.*?)' + self.cdel + var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + + #------------------------------------------------------------------------------ + # [ _escape_regex_special_chars method ] (string) + # Private method that escapes special regex metacharacters + # Returns a string with the escaped character modifications + #------------------------------------------------------------------------------ + def _escape_regex_special_chars(self, test_escape_string): + return re.escape(test_escape_string) + +#------------------------------------------------------------------------------ +# Renderer class +# Render the variable replacements in the ink template using a Python dictionary key argument +# Construct the instace of the Renderer with the Ink template and the dictionary key +# Run the renderer with the render method on the instance (e.g. r.render()) +# Parameters to constructor: +# - template = an Ink Template instance +# - key = a dictionary mapped key = variable name : value = variable replacement data +# - html_entities = encode html entities with HTML escaped characters (default = False = do not encode) +#------------------------------------------------------------------------------ + +class Renderer: + def __init__(self, template, key, html_entities=False): + self.odel = template.odel + self.cdel = template.cdel + self.template = template + self.html_entities = html_entities + self.key_dict = key + + #------------------------------------------------------------------------------ + # [ render method ] (string) + # renders the variable replacements in the Ink template + # returns the rendered template as a string + #------------------------------------------------------------------------------ + def render(self): + # make local variables for the loop below (faster) + local_dict = self.key_dict + local_template = self.template + local_varlist = self.template.varlist + local_odel = self.odel + local_cdel = self.cdel + local_htmlent = self.html_entities + if local_htmlent: + from xml.sax.saxutils import escape #from Python std lib + for key in local_dict: + if key in local_varlist: + value = local_dict[key] + replace_string = local_odel + key + local_cdel + if local_htmlent: + value = escape(value) #xml.sax.saxutils function + local_template = local_template.replace(replace_string, value) + return local_template + + ##TODO : multiple file render method? + + +if __name__ == '__main__': + pass + # template = Template("This is a of the {{test}} of the {{document}} {{type}} and more of the {{test}} {{document}} {{type}}") + # renderer = Renderer(template, {'test': 'ব য', 'document':'testing document', 'type':'of mine', 'bogus': 'bogus test'}) + # print(renderer.render()) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.c new file mode 100644 index 00000000..1e6857dc --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.c @@ -0,0 +1,10338 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:14 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__network +#define __PYX_HAVE_API__lib__Naked__toolshed__c__network +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "network.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000) +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.network' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.network" +int __pyx_module_is_main_lib__Naked__toolshed__c__network = 0; + +/* Implementation of 'lib.Naked.toolshed.c.network' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_open; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_request_timeout); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_4get_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_6get_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_8get_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_10head(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_12post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_14post_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_16post_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_18post_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_20response(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_22get_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_24post_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_[] = ""; +static char __pyx_k_e[] = "e"; +static char __pyx_k_f[] = "f"; +static char __pyx_k_w[] = "w"; +static char __pyx_k__2[] = "/"; +static char __pyx_k__4[] = "..."; +static char __pyx_k__6[] = " "; +static char __pyx_k_ce[] = "ce"; +static char __pyx_k_ok[] = "ok"; +static char __pyx_k_os[] = "os"; +static char __pyx_k_wb[] = "wb"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_get[] = "get"; +static char __pyx_k_res[] = "res"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_url[] = "url"; +static char __pyx_k_HTTP[] = "HTTP"; +static char __pyx_k_exit[] = "__exit__"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_head[] = "head"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_mode[] = "mode"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_open[] = "open"; +static char __pyx_k_post[] = "post"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_text[] = "text"; +static char __pyx_k_chunk[] = "chunk"; +static char __pyx_k_codes[] = "codes"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_enter[] = "__enter__"; +static char __pyx_k_flush[] = "flush"; +static char __pyx_k_fsync[] = "fsync"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_codecs[] = "codecs"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_exit_2[] = "exit"; +static char __pyx_k_fileno[] = "fileno"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_stream[] = "stream"; +static char __pyx_k_content[] = "content"; +static char __pyx_k_get_bin[] = "get_bin"; +static char __pyx_k_headers[] = "headers"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_timeout[] = "timeout"; +static char __pyx_k_HTTP_get[] = "HTTP.get"; +static char __pyx_k_encoding[] = "encoding"; +static char __pyx_k_filepath[] = "filepath"; +static char __pyx_k_post_bin[] = "post_bin"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_requests[] = "requests"; +static char __pyx_k_response[] = "response"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_HTTP_head[] = "HTTP.head"; +static char __pyx_k_HTTP_post[] = "HTTP.post"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_chunk_size[] = "chunk_size"; +static char __pyx_k_exceptions[] = "exceptions"; +static char __pyx_k_HTTP___init[] = "HTTP.__init__"; +static char __pyx_k_file_exists[] = "file_exists"; +static char __pyx_k_status_code[] = "status_code"; +static char __pyx_k_HTTP_get_bin[] = "HTTP.get_bin"; +static char __pyx_k_iter_content[] = "iter_content"; +static char __pyx_k_HTTP_post_bin[] = "HTTP.post_bin"; +static char __pyx_k_HTTP_response[] = "HTTP.response"; +static char __pyx_k_get_status_ok[] = "get_status_ok"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_post_status_ok[] = "post_status_ok"; +static char __pyx_k_ConnectionError[] = "ConnectionError"; +static char __pyx_k_allow_redirects[] = "allow_redirects"; +static char __pyx_k_request_timeout[] = "request_timeout"; +static char __pyx_k_suppress_output[] = "suppress_output"; +static char __pyx_k_follow_redirects[] = "follow_redirects"; +static char __pyx_k_Download_complete[] = "Download complete."; +static char __pyx_k_HTTP_get_status_ok[] = "HTTP.get_status_ok"; +static char __pyx_k_get_bin_write_file[] = "get_bin_write_file"; +static char __pyx_k_get_txt_write_file[] = "get_txt_write_file"; +static char __pyx_k_overwrite_existing[] = "overwrite_existing"; +static char __pyx_k_HTTP_post_status_ok[] = "HTTP.post_status_ok"; +static char __pyx_k_post_bin_write_file[] = "post_bin_write_file"; +static char __pyx_k_post_txt_write_file[] = "post_txt_write_file"; +static char __pyx_k_Downloading_file_from[] = "Downloading file from "; +static char __pyx_k_Naked_toolshed_system[] = "Naked.toolshed.system"; +static char __pyx_k_HTTP_get_bin_write_file[] = "HTTP.get_bin_write_file"; +static char __pyx_k_HTTP_get_txt_write_file[] = "HTTP.get_txt_write_file"; +static char __pyx_k_HTTP_post_bin_write_file[] = "HTTP.post_bin_write_file"; +static char __pyx_k_HTTP_post_txt_write_file[] = "HTTP.post_txt_write_file"; +static char __pyx_k_lib_Naked_toolshed_c_network[] = "lib.Naked.toolshed.c.network"; +static char __pyx_k_Naked_Framework_Error_Unable_to[] = "Naked Framework Error: Unable to perform GET request with the URL "; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/network.pyx"; +static char __pyx_k_using_the_get_bin_write_file_me[] = " using the get_bin_write_file() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_get_data_method_Naked[] = " using the get_data() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_get_data_write_txt_me[] = " using the get_data_write_txt() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_get_method_Naked_tool[] = " using the get() method (Naked.toolshed.network.py)"; +static char __pyx_k_using_the_post_data_write_bin_m[] = " using the post_data_write_bin() method (Naked.toolshed.network.py)"; +static char __pyx_k_Download_aborted_A_local_file_wi[] = "Download aborted. A local file with the requested filename exists on the path."; +static char __pyx_k_Naked_Framework_Error_Unable_to_2[] = "Naked Framework Error: Unable to perform GET request and write file with the URL "; +static char __pyx_k_Naked_Framework_Error_Unable_to_3[] = "Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_4[] = "Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_5[] = "Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_6[] = "Naked Framework Error: Unable to perform POST request and write file with the URL "; +static char __pyx_k_Naked_Framework_Error_Unable_to_7[] = "Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_8[] = "Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py)."; +static char __pyx_k_Naked_Framework_Error_Unable_to_9[] = "Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py)."; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ConnectionError; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_kp_s_Download_aborted_A_local_file_wi; +static PyObject *__pyx_kp_s_Download_complete; +static PyObject *__pyx_kp_s_Downloading_file_from; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_HTTP; +static PyObject *__pyx_n_s_HTTP___init; +static PyObject *__pyx_n_s_HTTP_get; +static PyObject *__pyx_n_s_HTTP_get_bin; +static PyObject *__pyx_n_s_HTTP_get_bin_write_file; +static PyObject *__pyx_n_s_HTTP_get_status_ok; +static PyObject *__pyx_n_s_HTTP_get_txt_write_file; +static PyObject *__pyx_n_s_HTTP_head; +static PyObject *__pyx_n_s_HTTP_post; +static PyObject *__pyx_n_s_HTTP_post_bin; +static PyObject *__pyx_n_s_HTTP_post_bin_write_file; +static PyObject *__pyx_n_s_HTTP_post_status_ok; +static PyObject *__pyx_n_s_HTTP_post_txt_write_file; +static PyObject *__pyx_n_s_HTTP_response; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Unable_to_9; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_system; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_n_s_allow_redirects; +static PyObject *__pyx_n_s_ce; +static PyObject *__pyx_n_s_chunk; +static PyObject *__pyx_n_s_chunk_size; +static PyObject *__pyx_n_s_codecs; +static PyObject *__pyx_n_s_codes; +static PyObject *__pyx_n_s_content; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_encoding; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exceptions; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_exit_2; +static PyObject *__pyx_n_s_f; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_file_exists; +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_n_s_filepath; +static PyObject *__pyx_n_s_flush; +static PyObject *__pyx_n_s_follow_redirects; +static PyObject *__pyx_n_s_fsync; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_bin; +static PyObject *__pyx_n_s_get_bin_write_file; +static PyObject *__pyx_n_s_get_status_ok; +static PyObject *__pyx_n_s_get_txt_write_file; +static PyObject *__pyx_n_s_head; +static PyObject *__pyx_n_s_headers; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_iter_content; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_network; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_ok; +static PyObject *__pyx_n_s_open; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_overwrite_existing; +static PyObject *__pyx_n_s_post; +static PyObject *__pyx_n_s_post_bin; +static PyObject *__pyx_n_s_post_bin_write_file; +static PyObject *__pyx_n_s_post_status_ok; +static PyObject *__pyx_n_s_post_txt_write_file; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_request_timeout; +static PyObject *__pyx_n_s_requests; +static PyObject *__pyx_n_s_res; +static PyObject *__pyx_n_s_response; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_status_code; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_stream; +static PyObject *__pyx_n_s_suppress_output; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_text; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_url; +static PyObject *__pyx_kp_s_using_the_get_bin_write_file_me; +static PyObject *__pyx_kp_s_using_the_get_data_method_Naked; +static PyObject *__pyx_kp_s_using_the_get_data_write_txt_me; +static PyObject *__pyx_kp_s_using_the_get_method_Naked_tool; +static PyObject *__pyx_kp_s_using_the_post_data_write_bin_m; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_w; +static PyObject *__pyx_n_s_wb; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_int_10; +static PyObject *__pyx_int_2048; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__52; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__49; +static PyObject *__pyx_codeobj__51; +static PyObject *__pyx_codeobj__53; + +/* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_url = 0; + PyObject *__pyx_v_request_timeout = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_url,&__pyx_n_s_request_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)__pyx_int_10)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_url); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_request_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_url = values[1]; + __pyx_v_request_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP___init__(__pyx_self, __pyx_v_self, __pyx_v_url, __pyx_v_request_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_request_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/network.pyx":16 + * class HTTP(): + * def __init__(self, url="", request_timeout=10): + * self.url = url # <<<<<<<<<<<<<< + * self.request_timeout = request_timeout + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_url, __pyx_v_url) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":17 + * def __init__(self, url="", request_timeout=10): + * self.url = url + * self.request_timeout = request_timeout # <<<<<<<<<<<<<< + * #------------------------------------------------------------------------------ + * # HTTP response properties (assignment occurs with the HTTP request methods) + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout, __pyx_v_request_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":21 + * # HTTP response properties (assignment occurs with the HTTP request methods) + * #------------------------------------------------------------------------------ + * self.res = None # assigned with the requests external library response object after a HTTP method call # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get = {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_follow_redirects = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_follow_redirects,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_True)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow_redirects); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_follow_redirects = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_2get(__pyx_self, __pyx_v_self, __pyx_v_follow_redirects); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get", 0); + + /* "lib/Naked/toolshed/c/network.pyx":33 + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): + * try: # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":34 + * def get(self, follow_redirects=True): + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allow_redirects, __pyx_v_follow_redirects) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":35 + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.text + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":36 + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_text); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":37 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":38 + * return response.text + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":39 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":40 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":41 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_kp_s_using_the_get_method_Naked_tool); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":42 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin = {__Pyx_NAMESTR("get_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_bin (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_4get_bin(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_4get_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_bin", 0); + + /* "lib/Naked/toolshed/c/network.pyx":50 + * #------------------------------------------------------------------------------ + * def get_bin(self): + * try: # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":51 + * def get_bin(self): + * try: + * response = requests.get(self.url, timeout=self.request_timeout) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance + * return response.content # return binary data instead of text (get() returns text) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":52 + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance # <<<<<<<<<<<<<< + * return response.content # return binary data instead of text (get() returns text) + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":53 + * response = requests.get(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance + * return response.content # return binary data instead of text (get() returns text) # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":54 + * self.res = response # assign the response object from requests to a property on the instance + * return response.content # return binary data instead of text (get() returns text) + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":55 + * return response.content # return binary data instead of text (get() returns text) + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":56 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":57 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":58 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_kp_s_using_the_get_data_method_Naked); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":59 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file = {__Pyx_NAMESTR("get_bin_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_bin_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_bin_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_bin_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_6get_bin_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_6get_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_bin_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":70 + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":71 + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":73 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":74 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":75 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":76 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":77 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":78 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":79 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":80 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":81 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":82 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":83 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":84 + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":85 + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":86 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*with:*/ { + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":87 + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) { + __pyx_t_10 = __pyx_t_11; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_11 = __pyx_t_16(__pyx_t_10); + if (unlikely(!__pyx_t_11)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_11); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_11); + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":88 + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":89 + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":90 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":86 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_4); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__5, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":91 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":92 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":93 + * if not suppress_output: + * print(" ") + * print("Download complete.") # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":94 + * print(" ") + * print("Download complete.") + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":95 + * print("Download complete.") + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_ce = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":96 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":97 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_e = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":98 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":99 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_get_bin_write_file_me); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":100 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file = {__Pyx_NAMESTR("get_txt_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_txt_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_txt_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_txt_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_8get_txt_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_8get_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_txt_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":110 + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":111 + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":113 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":114 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":115 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":116 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":117 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":118 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":119 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":120 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":121 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":122 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":123 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":124 + * sys.stdout.write("Downloading file from " + self.url + "...") + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * import codecs + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":125 + * sys.stdout.flush() + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":126 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): + */ + __pyx_t_11 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_codecs = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":127 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*with:*/ { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encoding, __pyx_kp_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_10); + __pyx_v_f = __pyx_t_10; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":128 + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * chunk = chunk.decode('utf-8') + * f.write(chunk) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_16(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":129 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_chunk, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":130 + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":131 + * chunk = chunk.decode('utf-8') + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":132 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":127 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_10, __pyx_t_11); + __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__9, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":133 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":134 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":135 + * if not suppress_output: + * print(" ") + * print("Download complete.") # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":136 + * print(" ") + * print("Download complete.") + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":137 + * print("Download complete.") + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_ce = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":138 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":139 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_e = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":140 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":141 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_get_data_write_txt_me); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":142 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head = {__Pyx_NAMESTR("head"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("head (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_10head(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_10head(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("head", 0); + + /* "lib/Naked/toolshed/c/network.pyx":154 + * #------------------------------------------------------------------------------ + * def head(self): + * try: # <<<<<<<<<<<<<< + * response = requests.head(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":155 + * def head(self): + * try: + * response = requests.head(self.url, timeout=self.request_timeout) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.headers + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_head); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":156 + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.headers + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":157 + * response = requests.head(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.headers # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_headers); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":158 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.headers + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.head", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":159 + * return response.headers + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":160 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.head", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":161 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":162 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":163 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.head", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post = {__Pyx_NAMESTR("post"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_follow_redirects = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_follow_redirects,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject *)Py_True)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow_redirects); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "post") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_follow_redirects = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("post", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_12post(__pyx_self, __pyx_v_self, __pyx_v_follow_redirects); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_12post(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_follow_redirects) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post", 0); + + /* "lib/Naked/toolshed/c/network.pyx":172 + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): + * try: # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":173 + * def post(self, follow_redirects=True): + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_post); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allow_redirects, __pyx_v_follow_redirects) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":174 + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.text + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":175 + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_text); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":176 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.text + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":177 + * return response.text + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":178 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":179 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":180 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":181 + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin = {__Pyx_NAMESTR("post_bin"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_bin (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_14post_bin(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_14post_bin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_response = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_bin", 0); + + /* "lib/Naked/toolshed/c/network.pyx":189 + * #------------------------------------------------------------------------------ + * def post_bin(self): + * try: # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":190 + * def post_bin(self): + * try: + * response = requests.post(self.url, timeout=self.request_timeout) # <<<<<<<<<<<<<< + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.content + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_post); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":191 + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class # <<<<<<<<<<<<<< + * return response.content + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":192 + * response = requests.post(self.url, timeout=self.request_timeout) + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.content # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":193 + * self.res = response # assign the response object from requests to a property on the instance of HTTP class + * return response.content + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":194 + * return response.content + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":195 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":196 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":197 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":198 + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file = {__Pyx_NAMESTR("post_bin_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_bin_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "post_bin_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("post_bin_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_16post_bin_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_16post_bin_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_bin_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":207 + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":208 + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":210 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":211 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":212 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":213 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":214 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":215 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":216 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":217 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":218 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":219 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":220 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":221 + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_post); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":222 + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":223 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*with:*/ { + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __Pyx_INCREF(__pyx_n_s_wb); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_wb); + __Pyx_GIVEREF(__pyx_n_s_wb); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_n_s_enter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_7); + __pyx_v_f = __pyx_t_7; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":224 + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) { + __pyx_t_10 = __pyx_t_11; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_11 = __pyx_t_16(__pyx_t_10); + if (unlikely(!__pyx_t_11)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_11); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_11); + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":225 + * with open(filepath, 'wb') as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":226 + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":227 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":223 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_4); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__14, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":228 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") # provide user with completion information + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":229 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":230 + * if not suppress_output: + * print(" ") + * print("Download complete.") # provide user with completion information # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":231 + * print(" ") + * print("Download complete.") # provide user with completion information + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":232 + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_11, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_ce = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":233 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":234 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_11); + __pyx_v_e = __pyx_t_11; + + /* "lib/Naked/toolshed/c/network.pyx":235 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":236 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_post_data_write_bin_m); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":237 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_bin_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file = {__Pyx_NAMESTR("post_txt_write_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_filepath = 0; + PyObject *__pyx_v_suppress_output = 0; + PyObject *__pyx_v_overwrite_existing = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_txt_write_file (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filepath,&__pyx_n_s_suppress_output,&__pyx_n_s_overwrite_existing,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s_)); + values[2] = ((PyObject *)((PyObject *)Py_False)); + values[3] = ((PyObject *)((PyObject *)Py_False)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filepath); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_output); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_overwrite_existing); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "post_txt_write_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_filepath = values[1]; + __pyx_v_suppress_output = values[2]; + __pyx_v_overwrite_existing = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("post_txt_write_file", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_18post_txt_write_file(__pyx_self, __pyx_v_self, __pyx_v_filepath, __pyx_v_suppress_output, __pyx_v_overwrite_existing); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_18post_txt_write_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_suppress_output, PyObject *__pyx_v_overwrite_existing) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_file_exists = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_codecs = NULL; + PyObject *__pyx_v_f = NULL; + PyObject *__pyx_v_chunk = NULL; + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + PyObject *__pyx_t_17 = NULL; + int __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_txt_write_file", 0); + __Pyx_INCREF(__pyx_v_filepath); + + /* "lib/Naked/toolshed/c/network.pyx":246 + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: # <<<<<<<<<<<<<< + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":247 + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + * try: + * import os # used for os.fsync() method in the write # <<<<<<<<<<<<<< + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":249 + * import os # used for os.fsync() method in the write + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: # <<<<<<<<<<<<<< + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_existing); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_6 = ((!__pyx_t_5) != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":250 + * # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists # <<<<<<<<<<<<<< + * if file_exists(filepath): + * if not suppress_output: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_file_exists); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_file_exists); + __Pyx_GIVEREF(__pyx_n_s_file_exists); + __pyx_t_7 = __Pyx_Import(__pyx_n_s_Naked_toolshed_system, __pyx_t_4, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_file_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_file_exists = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":251 + * if not overwrite_existing: + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): # <<<<<<<<<<<<<< + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + */ + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_file_exists, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/network.pyx":252 + * from Naked.toolshed.system import file_exists + * if file_exists(filepath): + * if not suppress_output: # <<<<<<<<<<<<<< + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_6) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":253 + * if file_exists(filepath): + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") # <<<<<<<<<<<<<< + * return False + * if (filepath == "" and len(self.url) > 1): + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_aborted_A_local_file_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":254 + * if not suppress_output: + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False # <<<<<<<<<<<<<< + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/network.pyx":255 + * print("Download aborted. A local file with the requested filename exists on the path.") + * return False + * if (filepath == "" and len(self.url) > 1): # <<<<<<<<<<<<<< + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + */ + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_filepath, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_5) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_8 > 1); + __pyx_t_9 = __pyx_t_6; + } else { + __pyx_t_9 = __pyx_t_5; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":256 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_filepath, __pyx_t_7); + __pyx_t_7 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/network.pyx":257 + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: # <<<<<<<<<<<<<< + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":258 + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user # <<<<<<<<<<<<<< + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Downloading_file_from, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":259 + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() # <<<<<<<<<<<<<< + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/network.pyx":260 + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) # <<<<<<<<<<<<<< + * self.res = response + * import codecs + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_post); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_request_timeout); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_timeout, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_stream, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_response = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":261 + * sys.stdout.flush() + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response # <<<<<<<<<<<<<< + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_res, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":262 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * import codecs # <<<<<<<<<<<<<< + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + */ + __pyx_t_11 = __Pyx_Import(__pyx_n_s_codecs, 0, -1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_v_codecs = __pyx_t_11; + __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":263 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*with:*/ { + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_codecs, __pyx_n_s_open); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encoding, __pyx_kp_s_utf_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L16_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /*try:*/ { + { + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + /*try:*/ { + __Pyx_INCREF(__pyx_t_10); + __pyx_v_f = __pyx_t_10; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":264 + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): # <<<<<<<<<<<<<< + * chunk = chunk.decode('utf-8') + * f.write(chunk) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_n_s_iter_content); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_chunk_size, __pyx_int_2048) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + __pyx_t_16 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_16(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_chunk, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":265 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_chunk, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":266 + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + * f.write(chunk) # <<<<<<<<<<<<<< + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_chunk); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":267 + * chunk = chunk.decode('utf-8') + * f.write(chunk) + * f.flush() # <<<<<<<<<<<<<< + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_flush); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":268 + * f.write(chunk) + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk # <<<<<<<<<<<<<< + * if not suppress_output: + * print(" ") + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_fsync); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_fileno); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L22_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L29_try_end; + __pyx_L22_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":263 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + /*except:*/ { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_17); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + __pyx_t_9 = ((!(__pyx_t_5 != 0)) != 0); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_10, __pyx_t_11); + __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L23_exception_handled; + } + __pyx_L24_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + goto __pyx_L3_error; + __pyx_L23_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_L29_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__17, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + goto __pyx_L21; + } + __pyx_L21:; + } + goto __pyx_L36; + __pyx_L16_error:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L3_error; + __pyx_L36:; + } + + /* "lib/Naked/toolshed/c/network.pyx":269 + * f.flush() + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: # <<<<<<<<<<<<<< + * print(" ") + * print("Download complete.") # provide user with completion information + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_output); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((!__pyx_t_9) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":270 + * os.fsync(f.fileno()) # flush all internal buffers to disk + * if not suppress_output: + * print(" ") # <<<<<<<<<<<<<< + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + */ + if (__Pyx_PrintOne(0, __pyx_kp_s__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/network.pyx":271 + * if not suppress_output: + * print(" ") + * print("Download complete.") # provide user with completion information # <<<<<<<<<<<<<< + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + */ + if (__Pyx_PrintOne(0, __pyx_kp_s_Download_complete) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L37; + } + __pyx_L37:; + + /* "lib/Naked/toolshed/c/network.pyx":272 + * print(" ") + * print("Download complete.") # provide user with completion information + * return True # return True if successful write # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":273 + * print("Download complete.") # provide user with completion information + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_ce = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":274 + * return True # return True if successful write + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":275 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + */ + __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_18) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_e = __pyx_t_10; + + /* "lib/Naked/toolshed/c/network.pyx":276 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/network.pyx":277 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_url); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = PyNumber_Add(__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_using_the_post_data_write_bin_m); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_20); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_19); + __pyx_t_19 = 0; + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_19); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + goto __pyx_L42; + } + __pyx_L42:; + + /* "lib/Naked/toolshed/c/network.pyx":278 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_txt_write_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_file_exists); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_codecs); + __Pyx_XDECREF(__pyx_v_f); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_filepath); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response = {__Pyx_NAMESTR("response"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("response (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_20response(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_20response(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("response", 0); + + /* "lib/Naked/toolshed/c/network.pyx":288 + * #------------------------------------------------------------------------------ + * def response(self): + * try: # <<<<<<<<<<<<<< + * return self.res + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":289 + * def response(self): + * try: + * return self.res # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":290 + * try: + * return self.res + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + */ + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_5) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.response", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/network.pyx":291 + * return self.res + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/network.pyx":292 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/network.pyx":293 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.response", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok = {__Pyx_NAMESTR("get_status_ok"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_status_ok (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_22get_status_ok(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_22get_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_status_ok", 0); + + /* "lib/Naked/toolshed/c/network.pyx":302 + * #------------------------------------------------------------------------------ + * def get_status_ok(self): + * try: # <<<<<<<<<<<<<< + * self.get() #run the get request + * if self.res and self.res.status_code: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":303 + * def get_status_ok(self): + * try: + * self.get() #run the get request # <<<<<<<<<<<<<< + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":304 + * try: + * self.get() #run the get request + * if self.res and self.res.status_code: # <<<<<<<<<<<<<< + * return (self.res.status_code == requests.codes.ok) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_status_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":305 + * self.get() #run the get request + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_status_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_codes); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/network.pyx":307 + * return (self.res.status_code == requests.codes.ok) + * else: + * return False # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":308 + * else: + * return False + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":309 + * return False + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":310 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":311 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":312 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/network.pyx":313 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.get_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok = {__Pyx_NAMESTR("post_status_ok"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("post_status_ok (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_24post_status_ok(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_7network_4HTTP_24post_status_ok(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *__pyx_v_ce = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("post_status_ok", 0); + + /* "lib/Naked/toolshed/c/network.pyx":321 + * #------------------------------------------------------------------------------ + * def post_status_ok(self): + * try: # <<<<<<<<<<<<<< + * self.post() #run the post request + * if self.res and self.res.status_code: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/network.pyx":322 + * def post_status_ok(self): + * try: + * self.post() #run the post request # <<<<<<<<<<<<<< + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_post); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":323 + * try: + * self.post() #run the post request + * if self.res and self.res.status_code: # <<<<<<<<<<<<<< + * return (self.res.status_code == requests.codes.ok) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_status_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __pyx_t_7; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":324 + * self.post() #run the post request + * if self.res and self.res.status_code: + * return (self.res.status_code == requests.codes.ok) # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_status_code); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_codes); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ok); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/network.pyx":326 + * return (self.res.status_code == requests.codes.ok) + * else: + * return False # <<<<<<<<<<<<<< + * except requests.exceptions.ConnectionError as ce: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":327 + * else: + * return False + * except requests.exceptions.ConnectionError as ce: # <<<<<<<<<<<<<< + * return False + * except Exception as e: + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_requests); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exceptions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ConnectionError); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_ce = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":328 + * return False + * except requests.exceptions.ConnectionError as ce: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/network.pyx":329 + * except requests.exceptions.ConnectionError as ce: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/network.pyx":330 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/network.pyx":331 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/network.pyx":332 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + * raise e # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.network.HTTP.post_status_ok", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ce); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("network"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_kp_s_Download_aborted_A_local_file_wi, __pyx_k_Download_aborted_A_local_file_wi, sizeof(__pyx_k_Download_aborted_A_local_file_wi), 0, 0, 1, 0}, + {&__pyx_kp_s_Download_complete, __pyx_k_Download_complete, sizeof(__pyx_k_Download_complete), 0, 0, 1, 0}, + {&__pyx_kp_s_Downloading_file_from, __pyx_k_Downloading_file_from, sizeof(__pyx_k_Downloading_file_from), 0, 0, 1, 0}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP, __pyx_k_HTTP, sizeof(__pyx_k_HTTP), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP___init, __pyx_k_HTTP___init, sizeof(__pyx_k_HTTP___init), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get, __pyx_k_HTTP_get, sizeof(__pyx_k_HTTP_get), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_bin, __pyx_k_HTTP_get_bin, sizeof(__pyx_k_HTTP_get_bin), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_bin_write_file, __pyx_k_HTTP_get_bin_write_file, sizeof(__pyx_k_HTTP_get_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_status_ok, __pyx_k_HTTP_get_status_ok, sizeof(__pyx_k_HTTP_get_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_get_txt_write_file, __pyx_k_HTTP_get_txt_write_file, sizeof(__pyx_k_HTTP_get_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_head, __pyx_k_HTTP_head, sizeof(__pyx_k_HTTP_head), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post, __pyx_k_HTTP_post, sizeof(__pyx_k_HTTP_post), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_bin, __pyx_k_HTTP_post_bin, sizeof(__pyx_k_HTTP_post_bin), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_bin_write_file, __pyx_k_HTTP_post_bin_write_file, sizeof(__pyx_k_HTTP_post_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_status_ok, __pyx_k_HTTP_post_status_ok, sizeof(__pyx_k_HTTP_post_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_post_txt_write_file, __pyx_k_HTTP_post_txt_write_file, sizeof(__pyx_k_HTTP_post_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_HTTP_response, __pyx_k_HTTP_response, sizeof(__pyx_k_HTTP_response), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to, __pyx_k_Naked_Framework_Error_Unable_to, sizeof(__pyx_k_Naked_Framework_Error_Unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_2, __pyx_k_Naked_Framework_Error_Unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_3, __pyx_k_Naked_Framework_Error_Unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_4, __pyx_k_Naked_Framework_Error_Unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_5, __pyx_k_Naked_Framework_Error_Unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_6, __pyx_k_Naked_Framework_Error_Unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_7, __pyx_k_Naked_Framework_Error_Unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_8, __pyx_k_Naked_Framework_Error_Unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_Unable_to_9, __pyx_k_Naked_Framework_Error_Unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_Unable_to_9), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_system, __pyx_k_Naked_toolshed_system, sizeof(__pyx_k_Naked_toolshed_system), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_n_s_allow_redirects, __pyx_k_allow_redirects, sizeof(__pyx_k_allow_redirects), 0, 0, 1, 1}, + {&__pyx_n_s_ce, __pyx_k_ce, sizeof(__pyx_k_ce), 0, 0, 1, 1}, + {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1}, + {&__pyx_n_s_chunk_size, __pyx_k_chunk_size, sizeof(__pyx_k_chunk_size), 0, 0, 1, 1}, + {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1}, + {&__pyx_n_s_codes, __pyx_k_codes, sizeof(__pyx_k_codes), 0, 0, 1, 1}, + {&__pyx_n_s_content, __pyx_k_content, sizeof(__pyx_k_content), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_exit_2, __pyx_k_exit_2, sizeof(__pyx_k_exit_2), 0, 0, 1, 1}, + {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1}, + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, + {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, + {&__pyx_n_s_follow_redirects, __pyx_k_follow_redirects, sizeof(__pyx_k_follow_redirects), 0, 0, 1, 1}, + {&__pyx_n_s_fsync, __pyx_k_fsync, sizeof(__pyx_k_fsync), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_bin, __pyx_k_get_bin, sizeof(__pyx_k_get_bin), 0, 0, 1, 1}, + {&__pyx_n_s_get_bin_write_file, __pyx_k_get_bin_write_file, sizeof(__pyx_k_get_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_get_status_ok, __pyx_k_get_status_ok, sizeof(__pyx_k_get_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_get_txt_write_file, __pyx_k_get_txt_write_file, sizeof(__pyx_k_get_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1}, + {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_iter_content, __pyx_k_iter_content, sizeof(__pyx_k_iter_content), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_network, __pyx_k_lib_Naked_toolshed_c_network, sizeof(__pyx_k_lib_Naked_toolshed_c_network), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_ok, __pyx_k_ok, sizeof(__pyx_k_ok), 0, 0, 1, 1}, + {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_overwrite_existing, __pyx_k_overwrite_existing, sizeof(__pyx_k_overwrite_existing), 0, 0, 1, 1}, + {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1}, + {&__pyx_n_s_post_bin, __pyx_k_post_bin, sizeof(__pyx_k_post_bin), 0, 0, 1, 1}, + {&__pyx_n_s_post_bin_write_file, __pyx_k_post_bin_write_file, sizeof(__pyx_k_post_bin_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_post_status_ok, __pyx_k_post_status_ok, sizeof(__pyx_k_post_status_ok), 0, 0, 1, 1}, + {&__pyx_n_s_post_txt_write_file, __pyx_k_post_txt_write_file, sizeof(__pyx_k_post_txt_write_file), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_request_timeout, __pyx_k_request_timeout, sizeof(__pyx_k_request_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_requests, __pyx_k_requests, sizeof(__pyx_k_requests), 0, 0, 1, 1}, + {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, + {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_status_code, __pyx_k_status_code, sizeof(__pyx_k_status_code), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_output, __pyx_k_suppress_output, sizeof(__pyx_k_suppress_output), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1}, + {&__pyx_kp_s_using_the_get_bin_write_file_me, __pyx_k_using_the_get_bin_write_file_me, sizeof(__pyx_k_using_the_get_bin_write_file_me), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_get_data_method_Naked, __pyx_k_using_the_get_data_method_Naked, sizeof(__pyx_k_using_the_get_data_method_Naked), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_get_data_write_txt_me, __pyx_k_using_the_get_data_write_txt_me, sizeof(__pyx_k_using_the_get_data_write_txt_me), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_get_method_Naked_tool, __pyx_k_using_the_get_method_Naked_tool, sizeof(__pyx_k_using_the_get_method_Naked_tool), 0, 0, 1, 0}, + {&__pyx_kp_s_using_the_post_data_write_bin_m, __pyx_k_using_the_post_data_write_bin_m, sizeof(__pyx_k_using_the_post_data_write_bin_m), 0, 0, 1, 0}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, + {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/network.pyx":80 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/network.pyx":86 + * response = requests.get(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/network.pyx":120 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/network.pyx":129 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "lib/Naked/toolshed/c/network.pyx":127 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/network.pyx":162 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_3); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/network.pyx":180 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_4); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/network.pyx":197 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_5); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/network.pyx":217 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "lib/Naked/toolshed/c/network.pyx":223 + * response = requests.post(self.url, timeout=self.request_timeout, stream=True) + * self.res = response + * with open(filepath, 'wb') as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * f.write(chunk) + */ + __pyx_tuple__14 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/network.pyx":256 + * return False + * if (filepath == "" and len(self.url) > 1): + * filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified # <<<<<<<<<<<<<< + * if not suppress_output: + * sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/network.pyx":265 + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') # <<<<<<<<<<<<<< + * f.write(chunk) + * f.flush() + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/network.pyx":263 + * self.res = response + * import codecs + * with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data # <<<<<<<<<<<<<< + * for chunk in response.iter_content(chunk_size=2048): + * chunk = chunk.decode('utf-8') + */ + __pyx_tuple__17 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "lib/Naked/toolshed/c/network.pyx":292 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_7); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/network.pyx":312 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_8); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "lib/Naked/toolshed/c/network.pyx":331 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Unable_to_9); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_url, __pyx_n_s_request_timeout); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__23 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s_), ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_tuple__24 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_follow_redirects, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__26 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_bin, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__29 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_bin_write_file, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__31 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__32 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_txt_write_file, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__34 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_head, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_follow_redirects, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__39 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_response, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_bin, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__42 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_bin_write_file, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__44 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_tuple__45 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_filepath, __pyx_n_s_suppress_output, __pyx_n_s_overwrite_existing, __pyx_n_s_os, __pyx_n_s_file_exists, __pyx_n_s_response, __pyx_n_s_codecs, __pyx_n_s_f, __pyx_n_s_chunk, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_txt_write_file, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__47 = PyTuple_Pack(3, ((PyObject*)__pyx_kp_s_), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_e); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_response, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_status_ok, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ce, __pyx_n_s_e); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_post_status_ok, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2048 = PyInt_FromLong(2048); if (unlikely(!__pyx_int_2048)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initnetwork(void); /*proto*/ +PyMODINIT_FUNC initnetwork(void) +#else +PyMODINIT_FUNC PyInit_network(void); /*proto*/ +PyMODINIT_FUNC PyInit_network(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_network(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("network"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__network) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.network")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.network", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/network.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * import requests + * from Naked.settings import debug as DEBUG_FLAG + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":6 + * + * import sys + * import requests # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_requests, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_requests, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":7 + * import sys + * import requests + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":14 + * # Uses the requests external library to handle HTTP requests and response object (available on PyPI) + * #------------------------------------------------------------------------------ + * class HTTP(): # <<<<<<<<<<<<<< + * def __init__(self, url="", request_timeout=10): + * self.url = url + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_HTTP, __pyx_n_s_HTTP, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_network, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/network.pyx":15 + * #------------------------------------------------------------------------------ + * class HTTP(): + * def __init__(self, url="", request_timeout=10): # <<<<<<<<<<<<<< + * self.url = url + * self.request_timeout = request_timeout + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_1__init__, 0, __pyx_n_s_HTTP___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__23); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":32 + * # test_http_post_reponse_change, test_http_get_response_check + * #------------------------------------------------------------------------------ + * def get(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_3get, 0, __pyx_n_s_HTTP_get, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__26); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":49 + * # returns data stream with raw binary data + * #------------------------------------------------------------------------------ + * def get_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.get(self.url, timeout=self.request_timeout) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_5get_bin, 0, __pyx_n_s_HTTP_get_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_bin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":69 + * # Tests: test_NETWORK.py :: test_http_get_binary + * #------------------------------------------------------------------------------ + * def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_7get_bin_write_file, 0, __pyx_n_s_HTTP_get_bin_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__31); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_bin_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":109 + * # Tests: test_NETWORK.py :: test_http_get_text + * #------------------------------------------------------------------------------ + * def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_9get_txt_write_file, 0, __pyx_n_s_HTTP_get_txt_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__34); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_txt_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":153 + * # Tests: test_NETWORK.py :: test_http_head + * #------------------------------------------------------------------------------ + * def head(self): # <<<<<<<<<<<<<< + * try: + * response = requests.head(self.url, timeout=self.request_timeout) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_11head, 0, __pyx_n_s_HTTP_head, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_head, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":171 + * # returns text from the URL as a string + * #------------------------------------------------------------------------------ + * def post(self, follow_redirects=True): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_13post, 0, __pyx_n_s_HTTP_post, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__39); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":188 + * # returns binary data from the URL + * #------------------------------------------------------------------------------ + * def post_bin(self): # <<<<<<<<<<<<<< + * try: + * response = requests.post(self.url, timeout=self.request_timeout) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_15post_bin, 0, __pyx_n_s_HTTP_post_bin, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_bin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":206 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_17post_bin_write_file, 0, __pyx_n_s_HTTP_post_bin_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__44); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_bin_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":245 + * # returns a boolean that indicates the success of the file write + * #------------------------------------------------------------------------------ + * def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): # <<<<<<<<<<<<<< + * try: + * import os # used for os.fsync() method in the write + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_19post_txt_write_file, 0, __pyx_n_s_HTTP_post_txt_write_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__47); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_txt_write_file, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":287 + * # Tests: test_NETWORK.py :: test_http_get_response_check + * #------------------------------------------------------------------------------ + * def response(self): # <<<<<<<<<<<<<< + * try: + * return self.res + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_21response, 0, __pyx_n_s_HTTP_response, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_response, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":301 + * # Tests: test_NETWORK.py :: + * #------------------------------------------------------------------------------ + * def get_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.get() #run the get request + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_23get_status_ok, 0, __pyx_n_s_HTTP_get_status_ok, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_status_ok, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":320 + * # Note: method runs its own post method, not necessary to run separately + * #------------------------------------------------------------------------------ + * def post_status_ok(self): # <<<<<<<<<<<<<< + * try: + * self.post() #run the post request + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_7network_4HTTP_25post_status_ok, 0, __pyx_n_s_HTTP_post_status_ok, NULL, __pyx_n_s_lib_Naked_toolshed_c_network, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_post_status_ok, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":14 + * # Uses the requests external library to handle HTTP requests and response object (available on PyPI) + * #------------------------------------------------------------------------------ + * class HTTP(): # <<<<<<<<<<<<<< + * def __init__(self, url="", request_timeout=10): + * self.url = url + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_HTTP, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_HTTP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/network.pyx":334 + * raise e + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * #------------------------------------------------------------------------------ + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/network.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.network", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.network"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.pyx new file mode 100644 index 00000000..34dadafb --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/network.pyx @@ -0,0 +1,352 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +import requests +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +#[ HTTP class] +# handle HTTP requests +# Uses the requests external library to handle HTTP requests and response object (available on PyPI) +#------------------------------------------------------------------------------ +class HTTP(): + def __init__(self, url="", request_timeout=10): + self.url = url + self.request_timeout = request_timeout + #------------------------------------------------------------------------------ + # HTTP response properties (assignment occurs with the HTTP request methods) + #------------------------------------------------------------------------------ + self.res = None # assigned with the requests external library response object after a HTTP method call + + #------------------------------------------------------------------------------ + # [ get method ] (string) - + # HTTP GET request - returns text string + # returns data stream read from the URL (string) + # Default timeout = 10 s from class constructor + # Re-throws ConnectionError on failed connection (e.g. no site at URL) + # Test : test_NETWORK.py :: test_http_get, test_http_get_response_change, + # test_http_post_reponse_change, test_http_get_response_check + #------------------------------------------------------------------------------ + def get(self, follow_redirects=True): + try: + response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_data method ] (binary data) + # HTTP GET request, return binary data + # returns data stream with raw binary data + #------------------------------------------------------------------------------ + def get_bin(self): + try: + response = requests.get(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance + return response.content # return binary data instead of text (get() returns text) + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_bin_write_file method ] (boolean) + # open HTTP data stream with GET request, make file with the returned binary data + # file path is passed to the method by the developer + # set suppress_output to True if you want to suppress the d/l status information that is printed to the standard output stream + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_binary + #------------------------------------------------------------------------------ + def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_txt_write_file method ] (boolean) + # open HTTP data stream with GET request, write file with utf-8 encoded text using returned text data + # file path is passed to the method by the developer (default is the base filename in the URL if not specified) + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_text + #------------------------------------------------------------------------------ + def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ head method ] (dictionary of strings) + # HTTP HEAD request + # returns a dictionary of the header strings + # test for a specific header on either the response dictionary or the instance res property + # Usage example: + # content_type = instance.res['content-type'] + # Tests: test_NETWORK.py :: test_http_head + #------------------------------------------------------------------------------ + def head(self): + try: + response = requests.head(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.headers + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ post method ] (string) + # HTTP POST request for text + # returns text from the URL as a string + #------------------------------------------------------------------------------ + def post(self, follow_redirects=True): + try: + response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin method ] (binary data) + # HTTP POST request for binary data + # returns binary data from the URL + #------------------------------------------------------------------------------ + def post_bin(self): + try: + response = requests.post(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.content + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin_write_file method ] (boolean = success of write) + # HTTP POST request, write binary file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ post_txt_write_file method ] (boolean = success of file write) + # HTTP POST request, write utf-8 encoded text file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ response method ] + # getter method for the requests library object that is assigned as a property + # on the HTTP class after a HTTP request method is run (e.g. get()) + # Note: must run one of the HTTP request verbs to assign this property before use of getter (=None by default) + # Tests: test_NETWORK.py :: test_http_get_response_check + #------------------------------------------------------------------------------ + def response(self): + try: + return self.res + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ get_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for GET request + # Note: this method runs its own GET request, does not need to be run separately + # Tests: test_NETWORK.py :: + #------------------------------------------------------------------------------ + def get_status_ok(self): + try: + self.get() #run the get request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for POST request + # Note: method runs its own post method, not necessary to run separately + #------------------------------------------------------------------------------ + def post_status_ok(self): + try: + self.post() #run the post request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + raise e + +if __name__ == '__main__': + pass + #------------------------------------------------------------------------------ + # HTTP GET 1 + #------------------------------------------------------------------------------ + # http = HTTP("http://www.google.com") + # data = http.get() + # print(data) + # from Naked.toolshed.file import FileWriter + # w = FileWriter("testfile.txt") + # w.write_utf8(data) + #------------------------------------------------------------------------------ + # HTTP GET 2 + #------------------------------------------------------------------------------ + # http = HTTP() + # http.url = "http://www.google.com" + # print(http.get()) + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.c new file mode 100644 index 00000000..e1a7e9ca --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.c @@ -0,0 +1,2650 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:15 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__python +#define __PYX_HAVE_API__lib__Naked__toolshed__c__python +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "python.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#ifndef CYTHON_PROFILE + #define CYTHON_PROFILE 1 +#endif +#ifndef CYTHON_TRACE + #define CYTHON_TRACE 0 +#endif +#if CYTHON_TRACE + #undef CYTHON_PROFILE_REUSE_FRAME +#endif +#ifndef CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_PROFILE_REUSE_FRAME 0 +#endif +#if CYTHON_PROFILE || CYTHON_TRACE + #include "compile.h" + #include "frameobject.h" + #include "traceback.h" + #if CYTHON_PROFILE_REUSE_FRAME + #define CYTHON_FRAME_MODIFIER static + #define CYTHON_FRAME_DEL + #else + #define CYTHON_FRAME_MODIFIER + #define CYTHON_FRAME_DEL Py_CLEAR(__pyx_frame) + #endif + #define __Pyx_TraceDeclarations \ + static PyCodeObject *__pyx_frame_code = NULL; \ + CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ + int __Pyx_use_tracing = 0; + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ + if (unlikely(PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) { \ + __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ + } + #define __Pyx_TraceException() \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && \ + (PyThreadState_GET()->c_profilefunc || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + PyObject *exc_info = __Pyx_GetExceptionTuple(); \ + if (exc_info) { \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ + Py_DECREF(exc_info); \ + } \ + tstate->use_tracing = 1; \ + } + #define __Pyx_TraceReturn(result) \ + if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + tstate->use_tracing = 0; \ + if (CYTHON_TRACE && tstate->c_tracefunc) \ + tstate->c_tracefunc( \ + tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + if (tstate->c_profilefunc) \ + tstate->c_profilefunc( \ + tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ + CYTHON_FRAME_DEL; \ + tstate->use_tracing = 1; \ + } + static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ + static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ +#else + #define __Pyx_TraceDeclarations + #define __Pyx_TraceCall(funcname, srcfile, firstlineno) + #define __Pyx_TraceException() + #define __Pyx_TraceReturn(result) +#endif /* CYTHON_PROFILE */ +#if CYTHON_TRACE + #define __Pyx_TraceLine(lineno) \ + if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) { \ + PyThreadState* tstate = PyThreadState_GET(); \ + __pyx_frame->f_lineno = lineno; \ + tstate->use_tracing = 0; \ + tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL); \ + tstate->use_tracing = 1; \ + } +#else + #define __Pyx_TraceLine(lineno) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.python' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.python" +int __pyx_module_is_main_lib__Naked__toolshed__c__python = 0; + +/* Implementation of 'lib.Naked.toolshed.c.python' */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_py_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_2py_major_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_4py_minor_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_6py_patch_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_8is_py2(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_10is_py3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_py2[] = "is_py2"; +static char __pyx_k_is_py3[] = "is_py3"; +static char __pyx_k_py_version[] = "py_version"; +static char __pyx_k_version_info[] = "version_info"; +static char __pyx_k_py_major_version[] = "py_major_version"; +static char __pyx_k_py_minor_version[] = "py_minor_version"; +static char __pyx_k_py_patch_version[] = "py_patch_version"; +static char __pyx_k_lib_Naked_toolshed_c_python[] = "lib.Naked.toolshed.c.python"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/python.pyx"; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_is_py2; +static PyObject *__pyx_n_s_is_py3; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_python; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_py_major_version; +static PyObject *__pyx_n_s_py_minor_version; +static PyObject *__pyx_n_s_py_patch_version; +static PyObject *__pyx_n_s_py_version; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_codeobj_; +static PyObject *__pyx_codeobj__2; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__6; + +/* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_1py_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_1py_version = {__Pyx_NAMESTR("py_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_1py_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_1py_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_py_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_py_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_version", 0); + __Pyx_TraceCall("py_version", __pyx_f[0], 14); + + /* "lib/Naked/toolshed/c/python.pyx":15 + * #------------------------------------------------------------------------------ + * def py_version(): + * return (version_info[0], version_info[1], version_info[2]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_3py_major_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_3py_major_version = {__Pyx_NAMESTR("py_major_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_3py_major_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_3py_major_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_major_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_2py_major_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_2py_major_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_major_version", 0); + __Pyx_TraceCall("py_major_version", __pyx_f[0], 21); + + /* "lib/Naked/toolshed/c/python.pyx":22 + * #------------------------------------------------------------------------------ + * def py_major_version(): + * return (version_info[0]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_major_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_5py_minor_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_5py_minor_version = {__Pyx_NAMESTR("py_minor_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_5py_minor_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_5py_minor_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_minor_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_4py_minor_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_4py_minor_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_minor_version", 0); + __Pyx_TraceCall("py_minor_version", __pyx_f[0], 28); + + /* "lib/Naked/toolshed/c/python.pyx":29 + * #------------------------------------------------------------------------------ + * def py_minor_version(): + * return (version_info[1]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_minor_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_7py_patch_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_7py_patch_version = {__Pyx_NAMESTR("py_patch_version"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_7py_patch_version, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_7py_patch_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("py_patch_version (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_6py_patch_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_6py_patch_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("py_patch_version", 0); + __Pyx_TraceCall("py_patch_version", __pyx_f[0], 35); + + /* "lib/Naked/toolshed/c/python.pyx":36 + * #------------------------------------------------------------------------------ + * def py_patch_version(): + * return (version_info[2]) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.py_patch_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_9is_py2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_9is_py2 = {__Pyx_NAMESTR("is_py2"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_9is_py2, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_9is_py2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_py2 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_8is_py2(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_8is_py2(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("is_py2", 0); + __Pyx_TraceCall("is_py2", __pyx_f[0], 42); + + /* "lib/Naked/toolshed/c/python.pyx":43 + * #------------------------------------------------------------------------------ + * def is_py2(): + * return (version_info[0] == (2)) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.is_py2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_11is_py3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6python_11is_py3 = {__Pyx_NAMESTR("is_py3"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6python_11is_py3, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6python_11is_py3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_py3 (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6python_10is_py3(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6python_10is_py3(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_TraceDeclarations + __Pyx_RefNannySetupContext("is_py3", 0); + __Pyx_TraceCall("is_py3", __pyx_f[0], 49); + + /* "lib/Naked/toolshed/c/python.pyx":50 + * #------------------------------------------------------------------------------ + * def is_py3(): + * return (version_info[0] == (3)) # <<<<<<<<<<<<<< + * + * if __name__ == '__main__': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.python.is_py3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_TraceReturn(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("python"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_is_py2, __pyx_k_is_py2, sizeof(__pyx_k_is_py2), 0, 0, 1, 1}, + {&__pyx_n_s_is_py3, __pyx_k_is_py3, sizeof(__pyx_k_is_py3), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_python, __pyx_k_lib_Naked_toolshed_c_python, sizeof(__pyx_k_lib_Naked_toolshed_c_python), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_py_major_version, __pyx_k_py_major_version, sizeof(__pyx_k_py_major_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_minor_version, __pyx_k_py_minor_version, sizeof(__pyx_k_py_minor_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_patch_version, __pyx_k_py_patch_version, sizeof(__pyx_k_py_patch_version), 0, 0, 1, 1}, + {&__pyx_n_s_py_version, __pyx_k_py_version, sizeof(__pyx_k_py_version), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + return 0; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_version, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_major_version, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_minor_version, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_py_patch_version, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_py2, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_py3, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initpython(void); /*proto*/ +PyMODINIT_FUNC initpython(void) +#else +PyMODINIT_FUNC PyInit_python(void); /*proto*/ +PyMODINIT_FUNC PyInit_python(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_python(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("python"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__python) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.python")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.python", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/python.pyx":5 + * # cython: profile=True + * + * from sys import version_info # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_version_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info); + __Pyx_GIVEREF(__pyx_n_s_version_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_info, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":14 + * # [ py_version function ] (tuple of (major, minor, patch)) + * #------------------------------------------------------------------------------ + * def py_version(): # <<<<<<<<<<<<<< + * return (version_info[0], version_info[1], version_info[2]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_1py_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":21 + * # Return Python interpreter major version number + * #------------------------------------------------------------------------------ + * def py_major_version(): # <<<<<<<<<<<<<< + * return (version_info[0]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_3py_major_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_major_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":28 + * # Return Python interpreter minor version number + * #------------------------------------------------------------------------------ + * def py_minor_version(): # <<<<<<<<<<<<<< + * return (version_info[1]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_5py_minor_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_minor_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":35 + * # Return Python interpreter patch version number + * #------------------------------------------------------------------------------ + * def py_patch_version(): # <<<<<<<<<<<<<< + * return (version_info[2]) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_7py_patch_version, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_patch_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":42 + * # Return truth result for question is interpreter running a version of Python 2 + * #------------------------------------------------------------------------------ + * def is_py2(): # <<<<<<<<<<<<<< + * return (version_info[0] == (2)) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_9is_py2, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_py2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":49 + * # Return truth result for question is interpreter running a version of Python 3 + * #------------------------------------------------------------------------------ + * def is_py3(): # <<<<<<<<<<<<<< + * return (version_info[0] == (3)) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6python_11is_py3, NULL, __pyx_n_s_lib_Naked_toolshed_c_python); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_py3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/python.pyx":52 + * return (version_info[0] == (3)) + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/python.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=True + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.python", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.python"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +#if CYTHON_PROFILE +static int __Pyx_TraceSetupAndCall(PyCodeObject** code, + PyFrameObject** frame, + const char *funcname, + const char *srcfile, + int firstlineno) { + int retval; + PyThreadState* tstate = PyThreadState_GET(); + if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { + if (*code == NULL) { + *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); + if (*code == NULL) return 0; + } + *frame = PyFrame_New( + tstate, /*PyThreadState *tstate*/ + *code, /*PyCodeObject *code*/ + __pyx_d, /*PyObject *globals*/ + 0 /*PyObject *locals*/ + ); + if (*frame == NULL) return 0; + if (CYTHON_TRACE && (*frame)->f_trace == NULL) { + Py_INCREF(Py_None); + (*frame)->f_trace = Py_None; + } +#if PY_VERSION_HEX < 0x030400B1 + } else { + (*frame)->f_tstate = tstate; +#endif + } + (*frame)->f_lineno = firstlineno; + tstate->use_tracing = 0; + #if CYTHON_TRACE + if (tstate->c_tracefunc) + tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL); + if (!tstate->c_profilefunc) + retval = 1; + else + #endif + retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; + tstate->use_tracing = (tstate->c_profilefunc || + (CYTHON_TRACE && tstate->c_tracefunc)); + return tstate->use_tracing && retval; +} +static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + PyCodeObject *py_code = 0; + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + py_srcfile = PyString_FromString(srcfile); + #else + py_funcname = PyUnicode_FromString(funcname); + py_srcfile = PyUnicode_FromString(srcfile); + #endif + if (!py_funcname | !py_srcfile) goto bad; + py_code = PyCode_New( + 0, /*int argcount,*/ + #if PY_MAJOR_VERSION >= 3 + 0, /*int kwonlyargcount,*/ + #endif + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + firstlineno, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return py_code; +} +#endif /* CYTHON_PROFILE */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.pyx new file mode 100644 index 00000000..7eaf8b62 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/python.pyx @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=True + +from sys import version_info + +#------------------------------------------------------------------------------ +# Python Versions +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ py_version function ] (tuple of (major, minor, patch)) +#------------------------------------------------------------------------------ +def py_version(): + return (version_info[0], version_info[1], version_info[2]) + +#------------------------------------------------------------------------------ +# [ py_major_version function ] (integer) +# Return Python interpreter major version number +#------------------------------------------------------------------------------ +def py_major_version(): + return (version_info[0]) + +#------------------------------------------------------------------------------ +# [ py_minor_version function ] (integer) +# Return Python interpreter minor version number +#------------------------------------------------------------------------------ +def py_minor_version(): + return (version_info[1]) + +#------------------------------------------------------------------------------ +# [ py_patch_version function ] (integer) +# Return Python interpreter patch version number +#------------------------------------------------------------------------------ +def py_patch_version(): + return (version_info[2]) + +#------------------------------------------------------------------------------ +# [ is_py2 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 2 +#------------------------------------------------------------------------------ +def is_py2(): + return (version_info[0] == (2)) + +#------------------------------------------------------------------------------ +# [ is_py3 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 3 +#------------------------------------------------------------------------------ +def is_py3(): + return (version_info[0] == (3)) + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/setup.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/setup.py new file mode 100644 index 00000000..5593ed97 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/setup.py @@ -0,0 +1,18 @@ +from distutils.core import setup +from distutils.extension import Extension + +ext_bench = Extension("benchmarking", ["benchmarking.c"]) +ext_casts = Extension("casts", ["casts.c"]) +ext_file = Extension("file", ["file.c"]) +ext_ink = Extension("ink", ["ink.c"]) +ext_net = Extension("network", ["network.c"]) +ext_py = Extension("python", ["python.c"]) +ext_shell = Extension("shell", ["shell.c"]) +ext_state = Extension("cstate", ["cstate.c"]) +ext_sys = Extension("system", ["system.c"]) +ext_types = Extension("types", ["types.c"]) + + +setup( + ext_modules = [ext_bench, ext_casts, ext_file, ext_ink, ext_net, ext_py, ext_shell, ext_state, ext_sys, ext_types] +) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.c new file mode 100644 index 00000000..9e5db7c0 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.c @@ -0,0 +1,8175 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:15 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__shell +#define __PYX_HAVE_API__lib__Naked__toolshed__c__shell +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "shell.pyx", +}; + +/*--- Type declarations ---*/ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.shell' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.shell" +int __pyx_module_is_main_lib__Naked__toolshed__c__shell = 0; + +/* Implementation of 'lib.Naked.toolshed.c.shell' */ +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name); /* proto */ +static char __pyx_k_e[] = "e"; +static char __pyx_k__4[] = ""; +static char __pyx_k__6[] = " "; +static char __pyx_k_os[] = "os"; +static char __pyx_k_te[] = "te"; +static char __pyx_k_cpe[] = "cpe"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_env[] = "env"; +static char __pyx_k_run[] = "run"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_call[] = "call"; +static char __pyx_k_exit[] = "exit"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_node[] = "node "; +static char __pyx_k_ruby[] = "ruby "; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_vars[] = "vars"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_shell[] = "shell"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_STDOUT[] = "STDOUT"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_var[] = "is_var"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_output[] = "output"; +static char __pyx_k_run_js[] = "run_js"; +static char __pyx_k_run_rb[] = "run_rb"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_command[] = "command"; +static char __pyx_k_environ[] = "environ"; +static char __pyx_k_execute[] = "execute"; +static char __pyx_k_get_var[] = "get_var"; +static char __pyx_k_muterun[] = "muterun"; +static char __pyx_k_pathsep[] = "pathsep"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_exitcode[] = "exitcode"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_response[] = "response"; +static char __pyx_k_var_name[] = "var_name"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_TypeError[] = "TypeError"; +static char __pyx_k_arguments[] = "arguments"; +static char __pyx_k_file_path[] = "file_path"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_execute_js[] = "execute_js"; +static char __pyx_k_execute_rb[] = "execute_rb"; +static char __pyx_k_js_command[] = "js_command"; +static char __pyx_k_muterun_js[] = "muterun_js"; +static char __pyx_k_muterun_rb[] = "muterun_rb"; +static char __pyx_k_rb_command[] = "rb_command"; +static char __pyx_k_returncode[] = "returncode"; +static char __pyx_k_subprocess[] = "subprocess"; +static char __pyx_k_Environment[] = "Environment"; +static char __pyx_k_NakedObject[] = "NakedObject"; +static char __pyx_k_check_output[] = "check_output"; +static char __pyx_k_response_obj[] = "response_obj"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_suppress_stderr[] = "suppress_stderr"; +static char __pyx_k_suppress_stdout[] = "suppress_stdout"; +static char __pyx_k_CalledProcessError[] = "CalledProcessError"; +static char __pyx_k_Environment___init[] = "Environment.__init__"; +static char __pyx_k_Environment_is_var[] = "Environment.is_var"; +static char __pyx_k_get_split_var_list[] = "get_split_var_list"; +static char __pyx_k_Environment_get_var[] = "Environment.get_var"; +static char __pyx_k_Naked_toolshed_types[] = "Naked.toolshed.types"; +static char __pyx_k_suppress_exit_status_call[] = "suppress_exit_status_call"; +static char __pyx_k_lib_Naked_toolshed_c_shell[] = "lib.Naked.toolshed.c.shell"; +static char __pyx_k_Environment_get_split_var_list[] = "Environment.get_split_var_list"; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/shell.pyx"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_7[] = "Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py)."; +static char __pyx_k_Naked_Framework_Error_unable_to_8[] = "Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell)."; +static char __pyx_k_Naked_Framework_Error_unable_to_9[] = "Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell)."; +static char __pyx_k_Naked_Framework_Error_unable_to_10[] = "Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell)."; +static PyObject *__pyx_n_s_CalledProcessError; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Environment; +static PyObject *__pyx_n_s_Environment___init; +static PyObject *__pyx_n_s_Environment_get_split_var_list; +static PyObject *__pyx_n_s_Environment_get_var; +static PyObject *__pyx_n_s_Environment_is_var; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_NakedObject; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_10; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_9; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_types; +static PyObject *__pyx_n_s_STDOUT; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_b__4; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_n_s_arguments; +static PyObject *__pyx_n_s_call; +static PyObject *__pyx_n_s_check_output; +static PyObject *__pyx_n_s_command; +static PyObject *__pyx_n_s_cpe; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_env; +static PyObject *__pyx_n_s_environ; +static PyObject *__pyx_n_s_execute; +static PyObject *__pyx_n_s_execute_js; +static PyObject *__pyx_n_s_execute_rb; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_exitcode; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_file_path; +static PyObject *__pyx_n_s_get_split_var_list; +static PyObject *__pyx_n_s_get_var; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_is_var; +static PyObject *__pyx_n_s_js_command; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_shell; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_muterun; +static PyObject *__pyx_n_s_muterun_js; +static PyObject *__pyx_n_s_muterun_rb; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_kp_s_node; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pathsep; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_rb_command; +static PyObject *__pyx_n_s_response; +static PyObject *__pyx_n_s_response_obj; +static PyObject *__pyx_n_s_returncode; +static PyObject *__pyx_kp_s_ruby; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_run_js; +static PyObject *__pyx_n_s_run_rb; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_shell; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_subprocess; +static PyObject *__pyx_n_s_suppress_exit_status_call; +static PyObject *__pyx_n_s_suppress_stderr; +static PyObject *__pyx_n_s_suppress_stdout; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_te; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_var_name; +static PyObject *__pyx_n_s_vars; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__19; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; + +/* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute(PyObject *__pyx_self, PyObject *__pyx_v_command); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_1execute = {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_1execute(PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(__pyx_self, ((PyObject *)__pyx_v_command)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_cpe = NULL; + CYTHON_UNUSED PyObject *__pyx_v_te = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":17 + * #------------------------------------------------------------------------------ + * def execute(command): + * try: # <<<<<<<<<<<<<< + * response = subprocess.call(command, shell=True) + * if response == 0: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":18 + * def execute(command): + * try: + * response = subprocess.call(command, shell=True) # <<<<<<<<<<<<<< + * if response == 0: + * return True + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_call); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_command); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_command); + __Pyx_GIVEREF(__pyx_v_command); + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_response = __pyx_t_7; + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":19 + * try: + * response = subprocess.call(command, shell=True) + * if response == 0: # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_response, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/shell.pyx":20 + * response = subprocess.call(command, shell=True) + * if response == 0: + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":22 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except subprocess.CalledProcessError as cpe: + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":23 + * else: + * return False + * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(cpe.output) + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_cpe = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":24 + * return False + * except subprocess.CalledProcessError as cpe: + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(cpe.output) + * except TypeError as te: + */ + { + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":25 + * except subprocess.CalledProcessError as cpe: + * try: + * sys.stderr.write(cpe.output) # <<<<<<<<<<<<<< + * except TypeError as te: + * sys.stderr.write(str(cpe.output)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L21_try_end; + __pyx_L14_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":26 + * try: + * sys.stderr.write(cpe.output) + * except TypeError as te: # <<<<<<<<<<<<<< + * sys.stderr.write(str(cpe.output)) + * except Exception as e: + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_14); + __pyx_v_te = __pyx_t_14; + + /* "lib/Naked/toolshed/c/shell.pyx":27 + * sys.stderr.write(cpe.output) + * except TypeError as te: + * sys.stderr.write(str(cpe.output)) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_17); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L15_exception_handled; + } + goto __pyx_L16_except_error; + __pyx_L16_except_error:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L5_except_error; + __pyx_L15_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_L21_try_end:; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/shell.pyx":28 + * except TypeError as te: + * sys.stderr.write(str(cpe.output)) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":29 + * sys.stderr.write(str(cpe.output)) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_8) { + + /* "lib/Naked/toolshed/c/shell.pyx":30 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L26; + } + __pyx_L26:; + + /* "lib/Naked/toolshed/c/shell.pyx":31 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_cpe); + __Pyx_XDECREF(__pyx_v_te); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_3run = {__Pyx_NAMESTR("run"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_3run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_command = 0; + PyObject *__pyx_v_suppress_stdout = 0; + PyObject *__pyx_v_suppress_stderr = 0; + PyObject *__pyx_v_suppress_exit_status_call = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_False); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_command)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_command = values[0]; + __pyx_v_suppress_stdout = values[1]; + __pyx_v_suppress_stderr = values[2]; + __pyx_v_suppress_exit_status_call = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(__pyx_self, __pyx_v_command, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_2run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) { + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_cpe = NULL; + CYTHON_UNUSED PyObject *__pyx_v_te = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("run", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":45 + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: # <<<<<<<<<<<<<< + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * if not suppress_stdout: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":46 + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) # <<<<<<<<<<<<<< + * if not suppress_stdout: + * print(response) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_check_output); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_command); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_command); + __Pyx_GIVEREF(__pyx_v_command); + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_stderr, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_response = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":47 + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * if not suppress_stdout: # <<<<<<<<<<<<<< + * print(response) + * return response + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_stdout); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_10 = ((!__pyx_t_9) != 0); + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":48 + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * if not suppress_stdout: + * print(response) # <<<<<<<<<<<<<< + * return response + * except subprocess.CalledProcessError as cpe: + */ + if (__Pyx_PrintOne(0, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":49 + * if not suppress_stdout: + * print(response) + * return response # <<<<<<<<<<<<<< + * except subprocess.CalledProcessError as cpe: + * if not suppress_stderr: # error in existing application (non-zero exit status) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_response); + __pyx_r = __pyx_v_response; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":50 + * print(response) + * return response + * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<< + * if not suppress_stderr: # error in existing application (non-zero exit status) + * try: + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_11) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_cpe = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":51 + * return response + * except subprocess.CalledProcessError as cpe: + * if not suppress_stderr: # error in existing application (non-zero exit status) # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(cpe.output) + */ + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_stderr); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_9 = ((!__pyx_t_10) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/shell.pyx":52 + * except subprocess.CalledProcessError as cpe: + * if not suppress_stderr: # error in existing application (non-zero exit status) + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(cpe.output) + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + */ + { + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":53 + * if not suppress_stderr: # error in existing application (non-zero exit status) + * try: + * sys.stderr.write(cpe.output) # <<<<<<<<<<<<<< + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + * sys.stderr.write(str(cpe.output)) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L22_try_end; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":54 + * try: + * sys.stderr.write(cpe.output) + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output # <<<<<<<<<<<<<< + * sys.stderr.write(str(cpe.output)) + * if not suppress_exit_status_call: + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_11) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_15, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_15); + __pyx_v_te = __pyx_t_15; + + /* "lib/Naked/toolshed/c/shell.pyx":55 + * sys.stderr.write(cpe.output) + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + * sys.stderr.write(str(cpe.output)) # <<<<<<<<<<<<<< + * if not suppress_exit_status_call: + * if cpe.returncode: + */ + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_stderr); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_17); + __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16_exception_handled; + } + goto __pyx_L17_except_error; + __pyx_L17_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L5_except_error; + __pyx_L16_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L22_try_end:; + } + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":56 + * except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + * sys.stderr.write(str(cpe.output)) + * if not suppress_exit_status_call: # <<<<<<<<<<<<<< + * if cpe.returncode: + * sys.exit(cpe.returncode) + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_suppress_exit_status_call); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_10 = ((!__pyx_t_9) != 0); + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":57 + * sys.stderr.write(str(cpe.output)) + * if not suppress_exit_status_call: + * if cpe.returncode: # <<<<<<<<<<<<<< + * sys.exit(cpe.returncode) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":58 + * if not suppress_exit_status_call: + * if cpe.returncode: + * sys.exit(cpe.returncode) # <<<<<<<<<<<<<< + * else: + * sys.exit(1) + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L26; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":60 + * sys.exit(cpe.returncode) + * else: + * sys.exit(1) # <<<<<<<<<<<<<< + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L26:; + goto __pyx_L25; + } + __pyx_L25:; + + /* "lib/Naked/toolshed/c/shell.pyx":61 + * else: + * sys.exit(1) + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/shell.pyx":62 + * sys.exit(1) + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + */ + __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_11) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":63 + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":64 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L29; + } + __pyx_L29:; + + /* "lib/Naked/toolshed/c/shell.pyx":65 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_cpe); + __Pyx_XDECREF(__pyx_v_te); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun(PyObject *__pyx_self, PyObject *__pyx_v_command); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_5muterun = {__Pyx_NAMESTR("muterun"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_5muterun(PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("muterun (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(__pyx_self, ((PyObject *)__pyx_v_command)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_4muterun(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_command) { + PyObject *__pyx_v_NakedObject = NULL; + PyObject *__pyx_v_response_obj = NULL; + PyObject *__pyx_v_response = NULL; + PyObject *__pyx_v_cpe = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("muterun", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":74 + * #------------------------------------------------------------------------------ + * def muterun(command): + * try: # <<<<<<<<<<<<<< + * from Naked.toolshed.types import NakedObject + * response_obj = NakedObject() + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":75 + * def muterun(command): + * try: + * from Naked.toolshed.types import NakedObject # <<<<<<<<<<<<<< + * response_obj = NakedObject() + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_NakedObject); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_NakedObject); + __Pyx_GIVEREF(__pyx_n_s_NakedObject); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_Naked_toolshed_types, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_NakedObject); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_NakedObject = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":76 + * try: + * from Naked.toolshed.types import NakedObject + * response_obj = NakedObject() # <<<<<<<<<<<<<< + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * response_obj.stdout = response + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_NakedObject, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_response_obj = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":77 + * from Naked.toolshed.types import NakedObject + * response_obj = NakedObject() + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) # <<<<<<<<<<<<<< + * response_obj.stdout = response + * response_obj.exitcode = 0 + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_check_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_command); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_command); + __Pyx_GIVEREF(__pyx_v_command); + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_stderr, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shell, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_response = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":78 + * response_obj = NakedObject() + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * response_obj.stdout = response # <<<<<<<<<<<<<< + * response_obj.exitcode = 0 + * response_obj.stderr = b"" + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stdout, __pyx_v_response) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":79 + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + * response_obj.stdout = response + * response_obj.exitcode = 0 # <<<<<<<<<<<<<< + * response_obj.stderr = b"" + * return response_obj + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":80 + * response_obj.stdout = response + * response_obj.exitcode = 0 + * response_obj.stderr = b"" # <<<<<<<<<<<<<< + * return response_obj + * except subprocess.CalledProcessError as cpe: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stderr, __pyx_kp_b__4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":81 + * response_obj.exitcode = 0 + * response_obj.stderr = b"" + * return response_obj # <<<<<<<<<<<<<< + * except subprocess.CalledProcessError as cpe: + * response_obj.stdout = b"" + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_response_obj); + __pyx_r = __pyx_v_response_obj; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":82 + * response_obj.stderr = b"" + * return response_obj + * except subprocess.CalledProcessError as cpe: # <<<<<<<<<<<<<< + * response_obj.stdout = b"" + * response_obj.stderr = cpe.output + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_subprocess); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CalledProcessError); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_cpe = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":83 + * return response_obj + * except subprocess.CalledProcessError as cpe: + * response_obj.stdout = b"" # <<<<<<<<<<<<<< + * response_obj.stderr = cpe.output + * if cpe.returncode: + */ + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stdout, __pyx_kp_b__4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":84 + * except subprocess.CalledProcessError as cpe: + * response_obj.stdout = b"" + * response_obj.stderr = cpe.output # <<<<<<<<<<<<<< + * if cpe.returncode: + * response_obj.exitcode = cpe.returncode + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_output); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_stderr, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":85 + * response_obj.stdout = b"" + * response_obj.stderr = cpe.output + * if cpe.returncode: # <<<<<<<<<<<<<< + * response_obj.exitcode = cpe.returncode + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":86 + * response_obj.stderr = cpe.output + * if cpe.returncode: + * response_obj.exitcode = cpe.returncode # <<<<<<<<<<<<<< + * else: + * response_obj.exitcode = 1 + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cpe, __pyx_n_s_returncode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L13; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":88 + * response_obj.exitcode = cpe.returncode + * else: + * response_obj.exitcode = 1 # <<<<<<<<<<<<<< + * return response_obj + * except Exception as e: + */ + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_response_obj, __pyx_n_s_exitcode, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/shell.pyx":89 + * else: + * response_obj.exitcode = 1 + * return response_obj # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_response_obj)) { __Pyx_RaiseUnboundLocalError("response_obj"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + __Pyx_INCREF(__pyx_v_response_obj); + __pyx_r = __pyx_v_response_obj; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_except_return; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/shell.pyx":90 + * response_obj.exitcode = 1 + * return response_obj + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __pyx_v_e = __pyx_t_8; + + /* "lib/Naked/toolshed/c/shell.pyx":91 + * return response_obj + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "lib/Naked/toolshed/c/shell.pyx":92 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/shell.pyx":93 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_NakedObject); + __Pyx_XDECREF(__pyx_v_response_obj); + __Pyx_XDECREF(__pyx_v_response); + __Pyx_XDECREF(__pyx_v_cpe); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_7execute_rb = {__Pyx_NAMESTR("execute_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_7execute_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute_rb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute_rb", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_6execute_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_rb_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute_rb", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":104 + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":105 + * def execute_rb(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":106 + * try: + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * rb_command = 'ruby ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":108 + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<< + * return execute(rb_command) # return result of execute() of the ruby file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":109 + * else: + * rb_command = 'ruby ' + file_path + * return execute(rb_command) # return result of execute() of the ruby file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_execute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_rb_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command); + __Pyx_GIVEREF(__pyx_v_rb_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":110 + * rb_command = 'ruby ' + file_path + * return execute(rb_command) # return result of execute() of the ruby file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":111 + * return execute(rb_command) # return result of execute() of the ruby file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":112 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":113 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rb_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_9run_rb = {__Pyx_NAMESTR("run_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_9run_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + PyObject *__pyx_v_suppress_stdout = 0; + PyObject *__pyx_v_suppress_stderr = 0; + PyObject *__pyx_v_suppress_exit_status_call = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_rb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_False); + values[4] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + __pyx_v_suppress_stdout = values[2]; + __pyx_v_suppress_stderr = values[3]; + __pyx_v_suppress_exit_status_call = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_rb", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_8run_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) { + PyObject *__pyx_v_rb_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("run_rb", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":120 + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":121 + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":122 + * try: + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * rb_command = 'ruby ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":124 + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<< + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":125 + * else: + * rb_command = 'ruby ' + file_path + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_run); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_rb_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command); + __Pyx_GIVEREF(__pyx_v_rb_command); + __Pyx_INCREF(__pyx_v_suppress_stdout); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_suppress_stdout); + __Pyx_GIVEREF(__pyx_v_suppress_stdout); + __Pyx_INCREF(__pyx_v_suppress_stderr); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_suppress_stderr); + __Pyx_GIVEREF(__pyx_v_suppress_stderr); + __Pyx_INCREF(__pyx_v_suppress_exit_status_call); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_suppress_exit_status_call); + __Pyx_GIVEREF(__pyx_v_suppress_exit_status_call); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":126 + * rb_command = 'ruby ' + file_path + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":127 + * return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":128 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":129 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rb_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb = {__Pyx_NAMESTR("muterun_rb"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("muterun_rb (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "muterun_rb") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("muterun_rb", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_10muterun_rb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_rb_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("muterun_rb", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":135 + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":136 + * def muterun_rb(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":137 + * try: + * if len(arguments) > 0: + * rb_command = 'ruby ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * rb_command = 'ruby ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":139 + * rb_command = 'ruby ' + file_path + " " + arguments + * else: + * rb_command = 'ruby ' + file_path # <<<<<<<<<<<<<< + * return muterun(rb_command) # return result of muterun() of the ruby file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_ruby, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_rb_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":140 + * else: + * rb_command = 'ruby ' + file_path + * return muterun(rb_command) # return result of muterun() of the ruby file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_muterun); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_rb_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_rb_command); + __Pyx_GIVEREF(__pyx_v_rb_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":141 + * rb_command = 'ruby ' + file_path + * return muterun(rb_command) # return result of muterun() of the ruby file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":142 + * return muterun(rb_command) # return result of muterun() of the ruby file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":143 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":144 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_rb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rb_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_13execute_js = {__Pyx_NAMESTR("execute_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_13execute_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("execute_js (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("execute_js", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_12execute_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_js_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("execute_js", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":157 + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":158 + * def execute_js(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * js_command = 'node ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":159 + * try: + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * js_command = 'node ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":161 + * js_command = 'node ' + file_path + " " + arguments + * else: + * js_command = 'node ' + file_path # <<<<<<<<<<<<<< + * return execute(js_command) # return result of execute() of node.js file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":162 + * else: + * js_command = 'node ' + file_path + * return execute(js_command) # return result of execute() of node.js file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_execute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_js_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command); + __Pyx_GIVEREF(__pyx_v_js_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":163 + * js_command = 'node ' + file_path + * return execute(js_command) # return result of execute() of node.js file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":164 + * return execute(js_command) # return result of execute() of node.js file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":165 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * #------------------------------------------------------------------------------ + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":166 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * #------------------------------------------------------------------------------ + * # [ run_js function ] (byte string or False) + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.execute_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_js_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_15run_js = {__Pyx_NAMESTR("run_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_15run_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + PyObject *__pyx_v_suppress_stdout = 0; + PyObject *__pyx_v_suppress_stderr = 0; + PyObject *__pyx_v_suppress_exit_status_call = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_js (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,&__pyx_n_s_suppress_stdout,&__pyx_n_s_suppress_stderr,&__pyx_n_s_suppress_exit_status_call,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_False); + values[4] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stdout); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_stderr); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_suppress_exit_status_call); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + __pyx_v_suppress_stdout = values[2]; + __pyx_v_suppress_stderr = values[3]; + __pyx_v_suppress_exit_status_call = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_js", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments, __pyx_v_suppress_stdout, __pyx_v_suppress_stderr, __pyx_v_suppress_exit_status_call); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_14run_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments, PyObject *__pyx_v_suppress_stdout, PyObject *__pyx_v_suppress_stderr, PyObject *__pyx_v_suppress_exit_status_call) { + PyObject *__pyx_v_js_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("run_js", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":177 + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":178 + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * js_command = 'node ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":179 + * try: + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * js_command = 'node ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":181 + * js_command = 'node ' + file_path + " " + arguments + * else: + * js_command = 'node ' + file_path # <<<<<<<<<<<<<< + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":182 + * else: + * js_command = 'node ' + file_path + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_run); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_js_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command); + __Pyx_GIVEREF(__pyx_v_js_command); + __Pyx_INCREF(__pyx_v_suppress_stdout); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_suppress_stdout); + __Pyx_GIVEREF(__pyx_v_suppress_stdout); + __Pyx_INCREF(__pyx_v_suppress_stderr); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_suppress_stderr); + __Pyx_GIVEREF(__pyx_v_suppress_stderr); + __Pyx_INCREF(__pyx_v_suppress_exit_status_call); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_suppress_exit_status_call); + __Pyx_GIVEREF(__pyx_v_suppress_exit_status_call); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":183 + * js_command = 'node ' + file_path + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":184 + * return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":185 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":186 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.run_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_js_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_17muterun_js = {__Pyx_NAMESTR("muterun_js"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_17muterun_js(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_path = 0; + PyObject *__pyx_v_arguments = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("muterun_js (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_arguments,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__4); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "muterun_js") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_file_path = values[0]; + __pyx_v_arguments = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("muterun_js", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(__pyx_self, __pyx_v_file_path, __pyx_v_arguments); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_16muterun_js(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_arguments) { + PyObject *__pyx_v_js_command = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("muterun_js", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":192 + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): + * try: # <<<<<<<<<<<<<< + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":193 + * def muterun_js(file_path, arguments=""): + * try: + * if len(arguments) > 0: # <<<<<<<<<<<<<< + * js_command = 'node ' + file_path + " " + arguments + * else: + */ + __pyx_t_4 = PyObject_Length(__pyx_v_arguments); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":194 + * try: + * if len(arguments) > 0: + * js_command = 'node ' + file_path + " " + arguments # <<<<<<<<<<<<<< + * else: + * js_command = 'node ' + file_path + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_v_arguments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L11; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":196 + * js_command = 'node ' + file_path + " " + arguments + * else: + * js_command = 'node ' + file_path # <<<<<<<<<<<<<< + * return muterun(js_command) # return result of muterun() of node.js file + * except Exception as e: + */ + __pyx_t_6 = PyNumber_Add(__pyx_kp_s_node, __pyx_v_file_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_js_command = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/shell.pyx":197 + * else: + * js_command = 'node ' + file_path + * return muterun(js_command) # return result of muterun() of node.js file # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_muterun); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_js_command); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_js_command); + __Pyx_GIVEREF(__pyx_v_js_command); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":198 + * js_command = 'node ' + file_path + * return muterun(js_command) # return result of muterun() of node.js file + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":199 + * return muterun(js_command) # return result of muterun() of node.js file + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":200 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":201 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.muterun_js", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_js_command); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":211 + * class Environment(): + * def __init__(self): + * self.env = os.environ # <<<<<<<<<<<<<< + * self.vars = list(os.environ.keys()) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_env, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":212 + * def __init__(self): + * self.env = os.environ + * self.vars = list(os.environ.keys()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vars, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var = {__Pyx_NAMESTR("is_var"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_var_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_var (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("is_var", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_var_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("is_var", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(__pyx_self, __pyx_v_self, __pyx_v_var_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_2is_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_var", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":219 + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): + * try: # <<<<<<<<<<<<<< + * return (var_name in self.vars) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":220 + * def is_var(self, var_name): + * try: + * return (var_name in self.vars) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":221 + * try: + * return (var_name in self.vars) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + */ + __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_6) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":222 + * return (var_name in self.vars) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + * raise e + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/shell.pyx":223 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/shell.pyx":224 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.is_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var = {__Pyx_NAMESTR("get_var"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_var_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_var (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_var", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_var") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_var_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_var", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(__pyx_self, __pyx_v_self, __pyx_v_var_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_4get_var(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_var", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":232 + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): + * try: # <<<<<<<<<<<<<< + * if var_name in self.vars: + * return self.env[var_name] + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":233 + * def get_var(self, var_name): + * try: + * if var_name in self.vars: # <<<<<<<<<<<<<< + * return self.env[var_name] + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":234 + * try: + * if var_name in self.vars: + * return self.env[var_name] # <<<<<<<<<<<<<< + * else: + * return "" + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_env); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_var_name); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":236 + * return self.env[var_name] + * else: + * return "" # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__4); + __pyx_r = __pyx_kp_s__4; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":237 + * else: + * return "" + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/shell.pyx":238 + * return "" + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":239 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":240 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_var", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list = {__Pyx_NAMESTR("get_split_var_list"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_var_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_split_var_list (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_var_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_var_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("get_split_var_list", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_split_var_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_var_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get_split_var_list", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(__pyx_self, __pyx_v_self, __pyx_v_var_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5shell_11Environment_6get_split_var_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_var_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_split_var_list", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":248 + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): + * try: # <<<<<<<<<<<<<< + * if var_name in self.vars: + * return self.env[var_name].split(os.pathsep) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":249 + * def get_split_var_list(self, var_name): + * try: + * if var_name in self.vars: # <<<<<<<<<<<<<< + * return self.env[var_name].split(os.pathsep) + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vars); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_var_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":250 + * try: + * if var_name in self.vars: + * return self.env[var_name].split(os.pathsep) # <<<<<<<<<<<<<< + * else: + * return [] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_env); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_v_var_name); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pathsep); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/shell.pyx":252 + * return self.env[var_name].split(os.pathsep) + * else: + * return [] # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":253 + * else: + * return [] + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + */ + __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_9) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + + /* "lib/Naked/toolshed/c/shell.pyx":254 + * return [] + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/shell.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/shell.pyx":256 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.shell.Environment.get_split_var_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("shell"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_CalledProcessError, __pyx_k_CalledProcessError, sizeof(__pyx_k_CalledProcessError), 0, 0, 1, 1}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Environment, __pyx_k_Environment, sizeof(__pyx_k_Environment), 0, 0, 1, 1}, + {&__pyx_n_s_Environment___init, __pyx_k_Environment___init, sizeof(__pyx_k_Environment___init), 0, 0, 1, 1}, + {&__pyx_n_s_Environment_get_split_var_list, __pyx_k_Environment_get_split_var_list, sizeof(__pyx_k_Environment_get_split_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_Environment_get_var, __pyx_k_Environment_get_var, sizeof(__pyx_k_Environment_get_var), 0, 0, 1, 1}, + {&__pyx_n_s_Environment_is_var, __pyx_k_Environment_is_var, sizeof(__pyx_k_Environment_is_var), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_10, __pyx_k_Naked_Framework_Error_unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_unable_to_10), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_7, __pyx_k_Naked_Framework_Error_unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_8, __pyx_k_Naked_Framework_Error_unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_9, __pyx_k_Naked_Framework_Error_unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_unable_to_9), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_types, __pyx_k_Naked_toolshed_types, sizeof(__pyx_k_Naked_toolshed_types), 0, 0, 1, 1}, + {&__pyx_n_s_STDOUT, __pyx_k_STDOUT, sizeof(__pyx_k_STDOUT), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1}, + {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, + {&__pyx_n_s_check_output, __pyx_k_check_output, sizeof(__pyx_k_check_output), 0, 0, 1, 1}, + {&__pyx_n_s_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1}, + {&__pyx_n_s_cpe, __pyx_k_cpe, sizeof(__pyx_k_cpe), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_env, __pyx_k_env, sizeof(__pyx_k_env), 0, 0, 1, 1}, + {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1}, + {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, + {&__pyx_n_s_execute_js, __pyx_k_execute_js, sizeof(__pyx_k_execute_js), 0, 0, 1, 1}, + {&__pyx_n_s_execute_rb, __pyx_k_execute_rb, sizeof(__pyx_k_execute_rb), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_exitcode, __pyx_k_exitcode, sizeof(__pyx_k_exitcode), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_path, __pyx_k_file_path, sizeof(__pyx_k_file_path), 0, 0, 1, 1}, + {&__pyx_n_s_get_split_var_list, __pyx_k_get_split_var_list, sizeof(__pyx_k_get_split_var_list), 0, 0, 1, 1}, + {&__pyx_n_s_get_var, __pyx_k_get_var, sizeof(__pyx_k_get_var), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_is_var, __pyx_k_is_var, sizeof(__pyx_k_is_var), 0, 0, 1, 1}, + {&__pyx_n_s_js_command, __pyx_k_js_command, sizeof(__pyx_k_js_command), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_shell, __pyx_k_lib_Naked_toolshed_c_shell, sizeof(__pyx_k_lib_Naked_toolshed_c_shell), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_muterun, __pyx_k_muterun, sizeof(__pyx_k_muterun), 0, 0, 1, 1}, + {&__pyx_n_s_muterun_js, __pyx_k_muterun_js, sizeof(__pyx_k_muterun_js), 0, 0, 1, 1}, + {&__pyx_n_s_muterun_rb, __pyx_k_muterun_rb, sizeof(__pyx_k_muterun_rb), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_kp_s_node, __pyx_k_node, sizeof(__pyx_k_node), 0, 0, 1, 0}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pathsep, __pyx_k_pathsep, sizeof(__pyx_k_pathsep), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_rb_command, __pyx_k_rb_command, sizeof(__pyx_k_rb_command), 0, 0, 1, 1}, + {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1}, + {&__pyx_n_s_response_obj, __pyx_k_response_obj, sizeof(__pyx_k_response_obj), 0, 0, 1, 1}, + {&__pyx_n_s_returncode, __pyx_k_returncode, sizeof(__pyx_k_returncode), 0, 0, 1, 1}, + {&__pyx_kp_s_ruby, __pyx_k_ruby, sizeof(__pyx_k_ruby), 0, 0, 1, 0}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_run_js, __pyx_k_run_js, sizeof(__pyx_k_run_js), 0, 0, 1, 1}, + {&__pyx_n_s_run_rb, __pyx_k_run_rb, sizeof(__pyx_k_run_rb), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_shell, __pyx_k_shell, sizeof(__pyx_k_shell), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_subprocess, __pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_exit_status_call, __pyx_k_suppress_exit_status_call, sizeof(__pyx_k_suppress_exit_status_call), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_stderr, __pyx_k_suppress_stderr, sizeof(__pyx_k_suppress_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_suppress_stdout, __pyx_k_suppress_stdout, sizeof(__pyx_k_suppress_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_var_name, __pyx_k_var_name, sizeof(__pyx_k_var_name), 0, 0, 1, 1}, + {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/shell.pyx":30 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/shell.pyx":60 + * sys.exit(cpe.returncode) + * else: + * sys.exit(1) # <<<<<<<<<<<<<< + * return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + * except Exception as e: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/shell.pyx":64 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/shell.pyx":92 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "lib/Naked/toolshed/c/shell.pyx":112 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/shell.pyx":128 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "lib/Naked/toolshed/c/shell.pyx":143 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_5); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "lib/Naked/toolshed/c/shell.pyx":165 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * #------------------------------------------------------------------------------ + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/shell.pyx":185 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/shell.pyx":200 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_7); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/shell.pyx":223 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_8); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "lib/Naked/toolshed/c/shell.pyx":239 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_9); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "lib/Naked/toolshed/c/shell.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_10); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_command, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + __pyx_tuple__18 = PyTuple_Pack(8, __pyx_n_s_command, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_te, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + __pyx_tuple__20 = PyTuple_Pack(6, __pyx_n_s_command, __pyx_n_s_NakedObject, __pyx_n_s_response_obj, __pyx_n_s_response, __pyx_n_s_cpe, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute_rb, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__24 = PyTuple_Pack(7, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run_rb, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_rb_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun_rb, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__28 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_execute_js, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_suppress_stdout, __pyx_n_s_suppress_stderr, __pyx_n_s_suppress_exit_status_call, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_run_js, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_file_path, __pyx_n_s_arguments, __pyx_n_s_js_command, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_muterun_js, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_var, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_var, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_var_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_get_split_var_list, 247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initshell(void); /*proto*/ +PyMODINIT_FUNC initshell(void) +#else +PyMODINIT_FUNC PyInit_shell(void); /*proto*/ +PyMODINIT_FUNC PyInit_shell(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_shell(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("shell"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__shell) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.shell")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.shell", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/shell.pyx":5 + * # cython: profile=False + * + * import os # <<<<<<<<<<<<<< + * import sys + * import subprocess + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":6 + * + * import os + * import sys # <<<<<<<<<<<<<< + * import subprocess + * from Naked.settings import debug as DEBUG_FLAG + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":7 + * import os + * import sys + * import subprocess # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_subprocess, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_subprocess, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":8 + * import sys + * import subprocess + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":16 + * # returns False if exit status != 0 + * #------------------------------------------------------------------------------ + * def execute(command): # <<<<<<<<<<<<<< + * try: + * response = subprocess.call(command, shell=True) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_1execute, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":44 + * # suppress_exit_status_call = False >> raise SystemExit with the returned status code + * #------------------------------------------------------------------------------ + * def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_3run, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_run, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":73 + * # return object attributes : stdout (bytes), stderr (bytes), exitcode (int) + * #------------------------------------------------------------------------------ + * def muterun(command): # <<<<<<<<<<<<<< + * try: + * from Naked.toolshed.types import NakedObject + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_5muterun, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":103 + * # execute a ruby script file in a shell subprocess + * #------------------------------------------------------------------------------ + * def execute_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_7execute_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":119 + * # execute a ruby script file in a shell subprocess, return the output + * #------------------------------------------------------------------------------ + * def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_9run_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":134 + * # [ muterun_rb function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_rb(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11muterun_rb, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun_rb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":156 + * # returns False for unsuccessful (!=0) exit status code + * #------------------------------------------------------------------------------ + * def execute_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_13execute_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_execute_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":176 + * # returns False if the subprocess exits with a non-zero exit code + * #------------------------------------------------------------------------------ + * def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_15run_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_run_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":191 + * # [ muterun_js function ] (NakedObject response object) + * #------------------------------------------------------------------------------ + * def muterun_js(file_path, arguments=""): # <<<<<<<<<<<<<< + * try: + * if len(arguments) > 0: + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_17muterun_js, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_muterun_js, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":209 + * # self.vars = the environment variable names list + * #------------------------------------------------------------------------------ + * class Environment(): # <<<<<<<<<<<<<< + * def __init__(self): + * self.env = os.environ + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Environment, __pyx_n_s_Environment, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/shell.pyx":210 + * #------------------------------------------------------------------------------ + * class Environment(): + * def __init__(self): # <<<<<<<<<<<<<< + * self.env = os.environ + * self.vars = list(os.environ.keys()) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_1__init__, 0, __pyx_n_s_Environment___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":218 + * # return boolean for presence of a variable name in the shell environment + * #------------------------------------------------------------------------------ + * def is_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * return (var_name in self.vars) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_3is_var, 0, __pyx_n_s_Environment_is_var, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_is_var, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":231 + * # returns empty string if the variable is not included in the environment variable list + * #------------------------------------------------------------------------------ + * def get_var(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_5get_var, 0, __pyx_n_s_Environment_get_var, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_var, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":247 + * # if the variable name is not in the environment list, returns an empty list + * #------------------------------------------------------------------------------ + * def get_split_var_list(self, var_name): # <<<<<<<<<<<<<< + * try: + * if var_name in self.vars: + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5shell_11Environment_7get_split_var_list, 0, __pyx_n_s_Environment_get_split_var_list, NULL, __pyx_n_s_lib_Naked_toolshed_c_shell, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_split_var_list, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":209 + * # self.vars = the environment variable names list + * #------------------------------------------------------------------------------ + * class Environment(): # <<<<<<<<<<<<<< + * def __init__(self): + * self.env = os.environ + */ + __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Environment, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Environment, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/shell.pyx":259 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # e = Environment() + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/shell.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.shell", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.shell"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.pyx new file mode 100644 index 00000000..728c9acb --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/shell.pyx @@ -0,0 +1,264 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import os +import sys +import subprocess +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ execute function ] (boolean) +# run a shell command and print std out / std err to terminal +# returns True if exit status = 0 +# returns False if exit status != 0 +#------------------------------------------------------------------------------ +def execute(command): + try: + response = subprocess.call(command, shell=True) + if response == 0: + return True + else: + return False + except subprocess.CalledProcessError as cpe: + try: + sys.stderr.write(cpe.output) + except TypeError as te: + sys.stderr.write(str(cpe.output)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ run function ] (bytes string or False) +# run a shell command +# default = +# success:: print to std out and return the std out string +# error:: print to stderr return False, suppress SystemExit on error to permit ongoing run of calling script +# suppress_stdout = True >> suppress std output stream print (returns string) +# suppress_stderr = True >> suppress std err stream print (returns False) +# suppress_exit_status_call = False >> raise SystemExit with the returned status code +#------------------------------------------------------------------------------ +def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + if not suppress_stdout: + print(response) + return response + except subprocess.CalledProcessError as cpe: + if not suppress_stderr: # error in existing application (non-zero exit status) + try: + sys.stderr.write(cpe.output) + except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + sys.stderr.write(str(cpe.output)) + if not suppress_exit_status_call: + if cpe.returncode: + sys.exit(cpe.returncode) + else: + sys.exit(1) + return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ muterun function ] (NakedObject with attributes for stdout, stderr, exitcode) +# run a shell command and return a response object +# return object attributes : stdout (bytes), stderr (bytes), exitcode (int) +#------------------------------------------------------------------------------ +def muterun(command): + try: + from Naked.toolshed.types import NakedObject + response_obj = NakedObject() + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + response_obj.stdout = response + response_obj.exitcode = 0 + response_obj.stderr = b"" + return response_obj + except subprocess.CalledProcessError as cpe: + response_obj.stdout = b"" + response_obj.stderr = cpe.output + if cpe.returncode: + response_obj.exitcode = cpe.returncode + else: + response_obj.exitcode = 1 + return response_obj + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# RUBY COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_rb function ] (boolean) +# execute a ruby script file in a shell subprocess +#------------------------------------------------------------------------------ +def execute_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return execute(rb_command) # return result of execute() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ run_rb function ] (bytes string or False) +# execute a ruby script file in a shell subprocess, return the output +#------------------------------------------------------------------------------ +def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_rb function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return muterun(rb_command) # return result of muterun() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# NODE.JS COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_js function ] (boolean) +# execute a node.js script file in a shell subprocess +# stdout stream to terminal +# returns True for success (=0) exit status code +# returns False for unsuccessful (!=0) exit status code +#------------------------------------------------------------------------------ +def execute_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return execute(js_command) # return result of execute() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e +#------------------------------------------------------------------------------ +# [ run_js function ] (byte string or False) +# execute a node.js script file in a shell subprocess +# print the standard output to the standard output stream by default +# set suppress_output to True to suppress stream to standard output. String is still returned to calling function +# set suppress_exit_status_call to True to suppress raising sys.exit on failures with shell subprocess exit status code (if available) or 1 if not available +# returns the standard output byte string from the subprocess executable on success +# returns False if the subprocess exits with a non-zero exit code +#------------------------------------------------------------------------------ +def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_js function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return muterun(js_command) # return result of muterun() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ Environment Class ] +# shell environment variables class +# self.env = the environment variable dictionary +# self.vars = the environment variable names list +#------------------------------------------------------------------------------ +class Environment(): + def __init__(self): + self.env = os.environ + self.vars = list(os.environ.keys()) + + #------------------------------------------------------------------------------ + # [ is_var method ] (boolean) + # return boolean for presence of a variable name in the shell environment + #------------------------------------------------------------------------------ + def is_var(self, var_name): + try: + return (var_name in self.vars) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_var method ] (string) + # get the variable value for a variable in the shell environment list + # returns empty string if the variable is not included in the environment variable list + #------------------------------------------------------------------------------ + def get_var(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name] + else: + return "" + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_split_var_list method ] (list of strings) + # return a list of strings split by OS dependent separator from the shell variable assigment string + # if the variable name is not in the environment list, returns an empty list + #------------------------------------------------------------------------------ + def get_split_var_list(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name].split(os.pathsep) + else: + return [] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + raise e + + +if __name__ == '__main__': + pass + # e = Environment() + # pathlist = e.get_split_var_list("PATH") + # for item in pathlist: + # print(item) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.c new file mode 100644 index 00000000..24565e9d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.c @@ -0,0 +1,13040 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__system +#define __PYX_HAVE_API__lib__Naked__toolshed__c__system +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "system.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam; +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam; + +/* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile { + PyObject_HEAD + PyObject *__pyx_v_func; +}; + + +/* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam { + PyObject_HEAD + PyObject *__pyx_v_func; +}; + + +/* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ +struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam { + PyObject_HEAD + PyObject *__pyx_v_func; +}; + +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 +static PyObject* __pyx_print = 0; +static PyObject* __pyx_print_kwargs = 0; +#endif + +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.system' */ +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = 0; +static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = 0; +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.system" +int __pyx_module_is_main_lib__Naked__toolshed__c__system = 0; + +/* Implementation of 'lib.Naked.toolshed.c.system' */ +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_OSError; +static PyObject *__pyx_builtin_SystemExit; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_dir, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_current_dir); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_match_pattern, PyObject *__pyx_v_full_path); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exit); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static char __pyx_k_e[] = "e"; +static char __pyx_k_x[] = "x"; +static char __pyx_k__8[] = ""; +static char __pyx_k_os[] = "os"; +static char __pyx_k__24[] = "."; +static char __pyx_k__36[] = "\n"; +static char __pyx_k_cwd[] = "cwd"; +static char __pyx_k_dir[] = "dir"; +static char __pyx_k_end[] = "end"; +static char __pyx_k_ose[] = "ose"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_args[] = "args"; +static char __pyx_k_exit[] = "exit"; +static char __pyx_k_file[] = "file"; +static char __pyx_k_func[] = "func"; +static char __pyx_k_glob[] = "glob"; +static char __pyx_k_iter[] = "iter"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "name"; +static char __pyx_k_path[] = "path"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_text[] = "text"; +static char __pyx_k_time[] = "time"; +static char __pyx_k_ctime[] = "ctime"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_errno[] = "errno"; +static char __pyx_k_isdir[] = "isdir"; +static char __pyx_k_print[] = "print"; +static char __pyx_k_wraps[] = "wraps"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_EEXIST[] = "EEXIST"; +static char __pyx_k_exists[] = "exists"; +static char __pyx_k_getcwd[] = "getcwd"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_is_dir[] = "is_dir"; +static char __pyx_k_isfile[] = "isfile"; +static char __pyx_k_islink[] = "islink"; +static char __pyx_k_kwargs[] = "kwargs"; +static char __pyx_k_name_2[] = "__name__"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_stdout[] = "stdout"; +static char __pyx_k_OSError[] = "OSError"; +static char __pyx_k_dirname[] = "dirname"; +static char __pyx_k_dirpath[] = "dirpath"; +static char __pyx_k_getsize[] = "getsize"; +static char __pyx_k_is_file[] = "is_file"; +static char __pyx_k_is_link[] = "is_link"; +static char __pyx_k_listdir[] = "listdir"; +static char __pyx_k_the_cwd[] = "the_cwd"; +static char __pyx_k_wrapper[] = "wrapper"; +static char __pyx_k_basename[] = "basename"; +static char __pyx_k_endswith[] = "endswith"; +static char __pyx_k_filename[] = "filename"; +static char __pyx_k_filepath[] = "filepath"; +static char __pyx_k_fullpath[] = "fullpath"; +static char __pyx_k_getmtime[] = "getmtime"; +static char __pyx_k_makedirs[] = "makedirs"; +static char __pyx_k_realpath[] = "realpath"; +static char __pyx_k_splitext[] = "splitext"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_directory[] = "directory"; +static char __pyx_k_exit_fail[] = "exit_fail"; +static char __pyx_k_file_name[] = "file_name"; +static char __pyx_k_file_size[] = "file_size"; +static char __pyx_k_filenames[] = "filenames"; +static char __pyx_k_full_path[] = "full_path"; +static char __pyx_k_functools[] = "functools"; +static char __pyx_k_make_dirs[] = "make_dirs"; +static char __pyx_k_make_path[] = "make_path"; +static char __pyx_k_path_list[] = "path_list"; +static char __pyx_k_real_path[] = "real_path"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_SystemExit[] = "SystemExit"; +static char __pyx_k_dir_exists[] = "dir_exists"; +static char __pyx_k_startswith[] = "startswith"; +static char __pyx_k_stderr_xnl[] = "stderr_xnl"; +static char __pyx_k_stdout_xnl[] = "stdout_xnl"; +static char __pyx_k_current_dir[] = "current_dir"; +static char __pyx_k_file_exists[] = "file_exists"; +static char __pyx_k_stdout_iter[] = "stdout_iter"; +static char __pyx_k_exit_success[] = "exit_success"; +static char __pyx_k_file_mod_time[] = "file_mod_time"; +static char __pyx_k_match_pattern[] = "match_pattern"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_file_extension[] = "file_extension"; +static char __pyx_k_list_all_files[] = "list_all_files"; +static char __pyx_k_stdout_iter_xnl[] = "stdout_iter_xnl"; +static char __pyx_k_exit_with_status[] = "exit_with_status"; +static char __pyx_k_extension_filter[] = "extension_filter"; +static char __pyx_k_list_match_files[] = "list_match_files"; +static char __pyx_k_current_directory[] = "current_directory"; +static char __pyx_k_list_filter_files[] = "list_filter_files"; +static char __pyx_k_filenames_fullpath[] = "filenames_fullpath"; +static char __pyx_k_list_all_files_cwd[] = "list_all_files_cwd"; +static char __pyx_k_currentdir_lastparam[] = "currentdir_lastparam"; +static char __pyx_k_currentdir_firstparam[] = "currentdir_firstparam"; +static char __pyx_k_list_filter_files_cwd[] = "list_filter_files_cwd"; +static char __pyx_k_currentdir_to_basefile[] = "currentdir_to_basefile"; +static char __pyx_k_lib_Naked_toolshed_c_system[] = "lib.Naked.toolshed.c.system"; +static char __pyx_k_Naked_Framework_Error_Could_not[] = "Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system)."; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/system.pyx"; +static char __pyx_k_Naked_Framework_Error_error_with[] = "Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system)."; +static char __pyx_k_currentdir_firstparam_locals_wra[] = "currentdir_firstparam..wrapper"; +static char __pyx_k_currentdir_lastparam_locals_wrap[] = "currentdir_lastparam..wrapper"; +static char __pyx_k_currentdir_to_basefile_locals_wr[] = "currentdir_to_basefile..wrapper"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_3[] = "Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_4[] = "Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_5[] = "Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_6[] = "Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_7[] = "Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_8[] = "Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_9[] = "Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_2[] = "Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_3[] = "Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_4[] = "Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_5[] = "Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_6[] = "Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_error_with_7[] = "Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_10[] = "Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_11[] = "Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_12[] = "Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_13[] = "Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_14[] = "Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_15[] = "Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_16[] = "Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system)."; +static char __pyx_k_Naked_Framework_Error_unable_to_17[] = "Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system)."; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_EEXIST; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_kp_s_Naked_Framework_Error_Could_not; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_error_with_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_10; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_11; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_12; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_13; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_14; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_15; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_16; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_17; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_3; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_4; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_5; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_6; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_7; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_8; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_9; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_OSError; +static PyObject *__pyx_n_s_SystemExit; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_kp_s__24; +static PyObject *__pyx_kp_s__36; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_basename; +static PyObject *__pyx_n_s_ctime; +static PyObject *__pyx_n_s_current_dir; +static PyObject *__pyx_n_s_current_directory; +static PyObject *__pyx_n_s_currentdir_firstparam; +static PyObject *__pyx_n_s_currentdir_firstparam_locals_wra; +static PyObject *__pyx_n_s_currentdir_lastparam; +static PyObject *__pyx_n_s_currentdir_lastparam_locals_wrap; +static PyObject *__pyx_n_s_currentdir_to_basefile; +static PyObject *__pyx_n_s_currentdir_to_basefile_locals_wr; +static PyObject *__pyx_n_s_cwd; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_dir; +static PyObject *__pyx_n_s_dir_exists; +static PyObject *__pyx_n_s_directory; +static PyObject *__pyx_n_s_dirname; +static PyObject *__pyx_n_s_dirpath; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_endswith; +static PyObject *__pyx_n_s_errno; +static PyObject *__pyx_n_s_exists; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_exit_fail; +static PyObject *__pyx_n_s_exit_success; +static PyObject *__pyx_n_s_exit_with_status; +static PyObject *__pyx_n_s_extension_filter; +static PyObject *__pyx_n_s_file; +static PyObject *__pyx_n_s_file_exists; +static PyObject *__pyx_n_s_file_extension; +static PyObject *__pyx_n_s_file_mod_time; +static PyObject *__pyx_n_s_file_name; +static PyObject *__pyx_n_s_file_size; +static PyObject *__pyx_n_s_filename; +static PyObject *__pyx_n_s_filenames; +static PyObject *__pyx_n_s_filenames_fullpath; +static PyObject *__pyx_n_s_filepath; +static PyObject *__pyx_n_s_full_path; +static PyObject *__pyx_n_s_fullpath; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_functools; +static PyObject *__pyx_n_s_getcwd; +static PyObject *__pyx_n_s_getmtime; +static PyObject *__pyx_n_s_getsize; +static PyObject *__pyx_n_s_glob; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_is_dir; +static PyObject *__pyx_n_s_is_file; +static PyObject *__pyx_n_s_is_link; +static PyObject *__pyx_n_s_isdir; +static PyObject *__pyx_n_s_isfile; +static PyObject *__pyx_n_s_islink; +static PyObject *__pyx_n_s_iter; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_system; +static PyObject *__pyx_n_s_list_all_files; +static PyObject *__pyx_n_s_list_all_files_cwd; +static PyObject *__pyx_n_s_list_filter_files; +static PyObject *__pyx_n_s_list_filter_files_cwd; +static PyObject *__pyx_n_s_list_match_files; +static PyObject *__pyx_n_s_listdir; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_dirs; +static PyObject *__pyx_n_s_make_path; +static PyObject *__pyx_n_s_makedirs; +static PyObject *__pyx_n_s_match_pattern; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_ose; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_path_list; +static PyObject *__pyx_n_s_print; +static PyObject *__pyx_n_s_real_path; +static PyObject *__pyx_n_s_realpath; +static PyObject *__pyx_n_s_splitext; +static PyObject *__pyx_n_s_startswith; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_stderr_xnl; +static PyObject *__pyx_n_s_stdout; +static PyObject *__pyx_n_s_stdout_iter; +static PyObject *__pyx_n_s_stdout_iter_xnl; +static PyObject *__pyx_n_s_stdout_xnl; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_text; +static PyObject *__pyx_n_s_the_cwd; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_wrapper; +static PyObject *__pyx_n_s_wraps; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__89; +static PyObject *__pyx_tuple__91; +static PyObject *__pyx_tuple__93; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__88; +static PyObject *__pyx_codeobj__90; +static PyObject *__pyx_codeobj__92; +static PyObject *__pyx_codeobj__94; +static PyObject *__pyx_codeobj__96; +static PyObject *__pyx_codeobj__98; +static PyObject *__pyx_codeobj__100; +static PyObject *__pyx_codeobj__101; +static PyObject *__pyx_codeobj__102; + +/* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_1filename = {__Pyx_NAMESTR("filename"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_1filename(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("filename (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_filename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("filename", 0); + + /* "lib/Naked/toolshed/c/system.pyx":21 + * #------------------------------------------------------------------------------ + * def filename(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.basename(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":22 + * def filename(filepath): + * try: + * return os.path.basename(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_basename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":23 + * try: + * return os.path.basename(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.filename", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":24 + * return os.path.basename(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":25 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":26 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.filename", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_3file_extension = {__Pyx_NAMESTR("file_extension"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_3file_extension(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_extension (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_2file_extension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_extension", 0); + + /* "lib/Naked/toolshed/c/system.pyx":34 + * #------------------------------------------------------------------------------ + * def file_extension(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.splitext(filepath)[1] + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":35 + * def file_extension(filepath): + * try: + * return os.path.splitext(filepath)[1] # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_splitext); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":36 + * try: + * return os.path.splitext(filepath)[1] + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_extension", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":37 + * return os.path.splitext(filepath)[1] + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":38 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":39 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_extension", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_5directory = {__Pyx_NAMESTR("directory"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_5directory(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("directory (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_4directory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("directory", 0); + + /* "lib/Naked/toolshed/c/system.pyx":48 + * #------------------------------------------------------------------------------ + * def directory(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.dirname(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":49 + * def directory(filepath): + * try: + * return os.path.dirname(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":50 + * try: + * return os.path.dirname(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.directory", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":51 + * return os.path.dirname(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":52 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":53 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.directory", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_7make_path = {__Pyx_NAMESTR("make_path"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_7make_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_path_list = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_path (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "make_path", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_path_list = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(__pyx_self, __pyx_v_path_list); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_path_list); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_6make_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_list) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_path", 0); + + /* "lib/Naked/toolshed/c/system.pyx":61 + * #------------------------------------------------------------------------------ + * def make_path(*path_list): + * try: # <<<<<<<<<<<<<< + * return os.path.join(*path_list) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":62 + * def make_path(*path_list): + * try: + * return os.path.join(*path_list) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PySequence_Tuple(__pyx_v_path_list); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":63 + * try: + * return os.path.join(*path_list) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":64 + * return os.path.join(*path_list) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":65 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":66 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile = {__Pyx_NAMESTR("currentdir_to_basefile"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile(PyObject *__pyx_self, PyObject *__pyx_v_func) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("currentdir_to_basefile (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(__pyx_self, ((PyObject *)__pyx_v_func)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_file_name = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_file_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrapper", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(__pyx_self, __pyx_v_file_name, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_file_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_outer_scope; + PyObject *__pyx_v_current_directory = NULL; + PyObject *__pyx_v_full_path = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/system.pyx":80 + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path # <<<<<<<<<<<<<< + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_current_directory = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":81 + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path # <<<<<<<<<<<<<< + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + * return wrapper + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_current_directory); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_current_directory); + __Pyx_GIVEREF(__pyx_v_current_directory); + __Pyx_INCREF(__pyx_v_file_name); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_file_name); + __Pyx_GIVEREF(__pyx_v_file_name); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_full_path = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":82 + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument # <<<<<<<<<<<<<< + * return wrapper + * except Exception as e: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_full_path); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_full_path); + __Pyx_GIVEREF(__pyx_v_full_path); + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_current_directory); + __Pyx_XDECREF(__pyx_v_full_path); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_8currentdir_to_basefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_cur_scope; + PyObject *__pyx_v_wraps = NULL; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("currentdir_to_basefile", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + + /* "lib/Naked/toolshed/c/system.pyx":75 + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): + * try: # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":76 + * def currentdir_to_basefile(func): + * try: + * from functools import wraps # <<<<<<<<<<<<<< + * + * @wraps(func) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_wraps = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":78 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_22currentdir_to_basefile_1wrapper, 0, __pyx_n_s_currentdir_to_basefile_locals_wr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "lib/Naked/toolshed/c/system.pyx":78 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(file_name, *args, **kwargs): + * current_directory = os.getcwd() #get current working directory path + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_wrapper = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":83 + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + * return wrapper # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":84 + * return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + * return wrapper + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":85 + * return wrapper + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":86 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":87 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_to_basefile", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wraps); + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam = {__Pyx_NAMESTR("currentdir_firstparam"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam(PyObject *__pyx_self, PyObject *__pyx_v_func) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("currentdir_firstparam (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(__pyx_self, ((PyObject *)__pyx_v_func)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_dir = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)((PyObject*)__pyx_kp_s__8)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + } + __pyx_v_dir = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(__pyx_self, __pyx_v_dir, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_wrapper(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_dir, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_outer_scope; + PyObject *__pyx_v_current_directory = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/system.pyx":100 + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() # <<<<<<<<<<<<<< + * return func(current_directory, *args, **kwargs) + * return wrapper + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_current_directory = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":101 + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) # <<<<<<<<<<<<<< + * return wrapper + * except Exception as e: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_current_directory); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_current_directory); + __Pyx_GIVEREF(__pyx_v_current_directory); + __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_current_directory); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_10currentdir_firstparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_cur_scope; + PyObject *__pyx_v_wraps = NULL; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("currentdir_firstparam", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + + /* "lib/Naked/toolshed/c/system.pyx":95 + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): + * try: # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":96 + * def currentdir_firstparam(func): + * try: + * from functools import wraps # <<<<<<<<<<<<<< + * + * @wraps(func) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_wraps = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":98 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21currentdir_firstparam_1wrapper, 0, __pyx_n_s_currentdir_firstparam_locals_wra, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__11); + + /* "lib/Naked/toolshed/c/system.pyx":98 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(dir="", *args, **kwargs): + * current_directory = os.getcwd() + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_wrapper = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":102 + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + * return wrapper # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":103 + * return func(current_directory, *args, **kwargs) + * return wrapper + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":104 + * return wrapper + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":105 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":106 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_firstparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wraps); + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam = {__Pyx_NAMESTR("currentdir_lastparam"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam(PyObject *__pyx_self, PyObject *__pyx_v_func) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("currentdir_lastparam (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(__pyx_self, ((PyObject *)__pyx_v_func)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrapper (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL; + __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); + if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_cur_scope; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_outer_scope; + PyObject *__pyx_v_the_cwd = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wrapper", 0); + __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "lib/Naked/toolshed/c/system.pyx":122 + * @wraps(func) + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() # <<<<<<<<<<<<<< + * return func(*args, current_dir=the_cwd) + * return wrapper + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_the_cwd = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":123 + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) # <<<<<<<<<<<<<< + * return wrapper + * except Exception as e: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_current_dir, __pyx_v_the_cwd) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_the_cwd); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_12currentdir_lastparam(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_cur_scope; + PyObject *__pyx_v_wraps = NULL; + PyObject *__pyx_v_wrapper = 0; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("currentdir_lastparam", 0); + __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(__pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_cur_scope); + __pyx_cur_scope->__pyx_v_func = __pyx_v_func; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + + /* "lib/Naked/toolshed/c/system.pyx":117 + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): + * try: # <<<<<<<<<<<<<< + * from functools import wraps + * + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":118 + * def currentdir_lastparam(func): + * try: + * from functools import wraps # <<<<<<<<<<<<<< + * + * @wraps(func) + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_wraps); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_wraps); + __Pyx_GIVEREF(__pyx_n_s_wraps); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_wraps = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":120 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_cur_scope->__pyx_v_func); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_wraps, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_20currentdir_lastparam_1wrapper, 0, __pyx_n_s_currentdir_lastparam_locals_wrap, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_system, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + + /* "lib/Naked/toolshed/c/system.pyx":120 + * from functools import wraps + * + * @wraps(func) # <<<<<<<<<<<<<< + * def wrapper(*args, **kwargs): + * the_cwd = os.getcwd() + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_wrapper = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":124 + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + * return wrapper # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrapper); + __pyx_r = __pyx_v_wrapper; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":125 + * return func(*args, current_dir=the_cwd) + * return wrapper + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":126 + * return wrapper + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":127 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":128 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.currentdir_lastparam", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wraps); + __Pyx_XDECREF(__pyx_v_wrapper); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath(PyObject *__pyx_self, PyObject *__pyx_v_file_name); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_15fullpath = {__Pyx_NAMESTR("fullpath"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_15fullpath(PyObject *__pyx_self, PyObject *__pyx_v_file_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fullpath (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(__pyx_self, ((PyObject *)__pyx_v_file_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_14fullpath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_name) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("fullpath", 0); + + /* "lib/Naked/toolshed/c/system.pyx":140 + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): + * try: # <<<<<<<<<<<<<< + * return file_name + * except Exception as e: + */ + { + if (__pyx_t_1||__pyx_t_2||__pyx_t_3); else {/*mark used*/}; + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":141 + * def fullpath(file_name): + * try: + * return file_name # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_file_name); + __pyx_r = __pyx_v_file_name; + goto __pyx_L7_try_return; + } + goto __pyx_L10_try_end; + __pyx_L7_try_return:; + goto __pyx_L0; + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_17cwd = {__Pyx_NAMESTR("cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_17cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cwd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_kp_s__8); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dir = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cwd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(__pyx_self, __pyx_v_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_16cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("cwd", 0); + + /* "lib/Naked/toolshed/c/system.pyx":157 + * @currentdir_firstparam + * def cwd(dir=""): + * try: # <<<<<<<<<<<<<< + * return dir + * except Exception as e: + */ + { + if (__pyx_t_1||__pyx_t_2||__pyx_t_3); else {/*mark used*/}; + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":158 + * def cwd(dir=""): + * try: + * return dir # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dir); + __pyx_r = __pyx_v_dir; + goto __pyx_L7_try_return; + } + goto __pyx_L10_try_end; + __pyx_L7_try_return:; + goto __pyx_L0; + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_19make_dirs = {__Pyx_NAMESTR("make_dirs"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_19make_dirs(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_dirs (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(__pyx_self, ((PyObject *)__pyx_v_dirpath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_18make_dirs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_v_os = NULL; + PyObject *__pyx_v_errno = NULL; + PyObject *__pyx_v_ose = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("make_dirs", 0); + + /* "lib/Naked/toolshed/c/system.pyx":177 + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): + * try: # <<<<<<<<<<<<<< + * import os + * import errno + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":178 + * def make_dirs(dirpath): + * try: + * import os # <<<<<<<<<<<<<< + * import errno + * os.makedirs(dirpath) + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_os = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":179 + * try: + * import os + * import errno # <<<<<<<<<<<<<< + * os.makedirs(dirpath) + * return True + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_errno, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_errno = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":180 + * import os + * import errno + * os.makedirs(dirpath) # <<<<<<<<<<<<<< + * return True + * except OSError as ose: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_makedirs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":181 + * import errno + * os.makedirs(dirpath) + * return True # <<<<<<<<<<<<<< + * except OSError as ose: + * if ose.errno != errno.EEXIST: # directory already exists + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":182 + * os.makedirs(dirpath) + * return True + * except OSError as ose: # <<<<<<<<<<<<<< + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OSError); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_ose = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":183 + * return True + * except OSError as ose: + * if ose.errno != errno.EEXIST: # directory already exists # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_ose, __pyx_n_s_errno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_v_errno)) { __Pyx_RaiseUnboundLocalError("errno"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_errno, __pyx_n_s_EEXIST); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_RichCompare(__pyx_t_8, __pyx_t_9, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":184 + * except OSError as ose: + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + * raise ose + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":185 + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise ose + * else: + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":186 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + * raise ose # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_Raise(__pyx_v_ose, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":188 + * raise ose + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * raise e + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_except_return; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + + /* "lib/Naked/toolshed/c/system.pyx":189 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":190 + * return False + * except Exception as e: + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.make_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_os); + __Pyx_XDECREF(__pyx_v_errno); + __Pyx_XDECREF(__pyx_v_ose); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21file_exists = {__Pyx_NAMESTR("file_exists"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_21file_exists(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_exists (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_20file_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_exists", 0); + + /* "lib/Naked/toolshed/c/system.pyx":204 + * #------------------------------------------------------------------------------ + * def file_exists(filepath): + * try: # <<<<<<<<<<<<<< + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + * return True + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":205 + * def file_exists(filepath): + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":206 + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":208 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":209 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":210 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":211 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":212 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_23is_file = {__Pyx_NAMESTR("is_file"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_23is_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_file (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_22is_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_file", 0); + + /* "lib/Naked/toolshed/c/system.pyx":221 + * #------------------------------------------------------------------------------ + * def is_file(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.isfile(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":222 + * def is_file(filepath): + * try: + * return os.path.isfile(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":223 + * try: + * return os.path.isfile(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":224 + * return os.path.isfile(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":225 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":226 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_25dir_exists = {__Pyx_NAMESTR("dir_exists"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_25dir_exists(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("dir_exists (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(__pyx_self, ((PyObject *)__pyx_v_dirpath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_24dir_exists(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("dir_exists", 0); + + /* "lib/Naked/toolshed/c/system.pyx":234 + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): + * try: # <<<<<<<<<<<<<< + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + * return True + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":235 + * def dir_exists(dirpath): + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":236 + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":238 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":239 + * else: + * return False + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.dir_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":240 + * return False + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":241 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":242 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.dir_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir(PyObject *__pyx_self, PyObject *__pyx_v_dirpath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_27is_dir = {__Pyx_NAMESTR("is_dir"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_27is_dir(PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_dir (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(__pyx_self, ((PyObject *)__pyx_v_dirpath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_26is_dir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dirpath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_dir", 0); + + /* "lib/Naked/toolshed/c/system.pyx":251 + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): + * try: # <<<<<<<<<<<<<< + * return os.path.isdir(dirpath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":252 + * def is_dir(dirpath): + * try: + * return os.path.isdir(dirpath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isdir); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dirpath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dirpath); + __Pyx_GIVEREF(__pyx_v_dirpath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":253 + * try: + * return os.path.isdir(dirpath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":254 + * return os.path.isdir(dirpath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":256 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_dir", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_29file_size = {__Pyx_NAMESTR("file_size"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_29file_size(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_size (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_28file_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_size", 0); + + /* "lib/Naked/toolshed/c/system.pyx":270 + * #------------------------------------------------------------------------------ + * def file_size(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.getsize(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":271 + * def file_size(filepath): + * try: + * return os.path.getsize(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":272 + * try: + * return os.path.getsize(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_size", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":273 + * return os.path.getsize(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":274 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":275 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_size", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_31file_mod_time = {__Pyx_NAMESTR("file_mod_time"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_31file_mod_time(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("file_mod_time (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_30file_mod_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_time = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("file_mod_time", 0); + + /* "lib/Naked/toolshed/c/system.pyx":283 + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): + * try: # <<<<<<<<<<<<<< + * import time + * return time.ctime(os.path.getmtime(filepath)) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":284 + * def file_mod_time(filepath): + * try: + * import time # <<<<<<<<<<<<<< + * return time.ctime(os.path.getmtime(filepath)) + * except Exception as e: + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_time = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":285 + * try: + * import time + * return time.ctime(os.path.getmtime(filepath)) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_time, __pyx_n_s_ctime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getmtime); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":286 + * import time + * return time.ctime(os.path.getmtime(filepath)) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_mod_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":287 + * return time.ctime(os.path.getmtime(filepath)) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":288 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":289 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.file_mod_time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_time); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files(PyObject *__pyx_self, PyObject *__pyx_v_dir); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_33list_all_files = {__Pyx_NAMESTR("list_all_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_33list_all_files(PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_all_files (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(__pyx_self, ((PyObject *)__pyx_v_dir)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_32list_all_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_filenames = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_all_files", 0); + + /* "lib/Naked/toolshed/c/system.pyx":303 + * #------------------------------------------------------------------------------ + * def list_all_files(dir): + * try: # <<<<<<<<<<<<<< + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + * return filenames + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":304 + * def list_all_files(dir): + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] # <<<<<<<<<<<<<< + * return filenames + * except Exception as e: + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_listdir); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isfile); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_12) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_name))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_filenames = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":305 + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + * return filenames # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames); + __pyx_r = __pyx_v_filenames; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":306 + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + * return filenames + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":307 + * return filenames + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_12) { + + /* "lib/Naked/toolshed/c/system.pyx":308 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/system.pyx":309 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_filenames); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_35list_filter_files = {__Pyx_NAMESTR("list_filter_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_35list_filter_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_extension_filter = 0; + PyObject *__pyx_v_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_filter_files (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extension_filter,&__pyx_n_s_dir,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extension_filter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("list_filter_files", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_filter_files") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_extension_filter = values[0]; + __pyx_v_dir = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_filter_files", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(__pyx_self, __pyx_v_extension_filter, __pyx_v_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_34list_filter_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_filenames = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_filter_files", 0); + __Pyx_INCREF(__pyx_v_extension_filter); + + /* "lib/Naked/toolshed/c/system.pyx":319 + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): + * try: # <<<<<<<<<<<<<< + * if not extension_filter.startswith("."): + * extension_filter = "." + extension_filter + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":320 + * def list_filter_files(extension_filter, dir): + * try: + * if not extension_filter.startswith("."): # <<<<<<<<<<<<<< + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_extension_filter, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = ((!__pyx_t_6) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":321 + * try: + * if not extension_filter.startswith("."): + * extension_filter = "." + extension_filter # <<<<<<<<<<<<<< + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + * return filenames + */ + __pyx_t_5 = PyNumber_Add(__pyx_kp_s__24, __pyx_v_extension_filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_extension_filter, __pyx_t_5); + __pyx_t_5 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/system.pyx":322 + * if not extension_filter.startswith("."): + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] # <<<<<<<<<<<<<< + * return filenames + * except Exception as e: + */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_listdir); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_9 = __pyx_t_11(__pyx_t_4); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_extension_filter); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_extension_filter); + __Pyx_GIVEREF(__pyx_v_extension_filter); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_7) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_v_name))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + goto __pyx_L14; + } + __pyx_L14:; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_filenames = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":323 + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + * return filenames # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames); + __pyx_r = __pyx_v_filenames; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":324 + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + * return filenames + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_e = __pyx_t_4; + + /* "lib/Naked/toolshed/c/system.pyx":325 + * return filenames + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":326 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/system.pyx":327 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_filenames); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_extension_filter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd = {__Pyx_NAMESTR("list_all_files_cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_all_files_cwd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dir,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_kp_s__8); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dir); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_all_files_cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_dir = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_all_files_cwd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(__pyx_self, __pyx_v_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_36list_all_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dir) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_all_files_cwd", 0); + + /* "lib/Naked/toolshed/c/system.pyx":339 + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): + * try: # <<<<<<<<<<<<<< + * return list_all_files(dir) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":340 + * def list_all_files_cwd(dir=""): + * try: + * return list_all_files(dir) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_all_files); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_dir); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dir); + __Pyx_GIVEREF(__pyx_v_dir); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":341 + * try: + * return list_all_files(dir) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":342 + * return list_all_files(dir) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":343 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":344 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_all_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd = {__Pyx_NAMESTR("list_filter_files_cwd"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_extension_filter = 0; + PyObject *__pyx_v_current_dir = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_filter_files_cwd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_extension_filter,&__pyx_n_s_current_dir,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_kp_s__8); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_extension_filter)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_current_dir); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_filter_files_cwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_extension_filter = values[0]; + __pyx_v_current_dir = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_filter_files_cwd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(__pyx_self, __pyx_v_extension_filter, __pyx_v_current_dir); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_38list_filter_files_cwd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_extension_filter, PyObject *__pyx_v_current_dir) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_filter_files_cwd", 0); + + /* "lib/Naked/toolshed/c/system.pyx":356 + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: # <<<<<<<<<<<<<< + * return list_filter_files(extension_filter, current_dir) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":357 + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: + * return list_filter_files(extension_filter, current_dir) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_filter_files); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_extension_filter); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_extension_filter); + __Pyx_GIVEREF(__pyx_v_extension_filter); + __Pyx_INCREF(__pyx_v_current_dir); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_current_dir); + __Pyx_GIVEREF(__pyx_v_current_dir); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":358 + * try: + * return list_filter_files(extension_filter, current_dir) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":359 + * return list_filter_files(extension_filter, current_dir) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":360 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":361 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_filter_files_cwd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_41list_match_files = {__Pyx_NAMESTR("list_match_files"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_41list_match_files(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_match_pattern = 0; + PyObject *__pyx_v_full_path = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("list_match_files (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_pattern,&__pyx_n_s_full_path,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_match_pattern)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_full_path); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_match_files") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_match_pattern = values[0]; + __pyx_v_full_path = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_match_files", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(__pyx_self, __pyx_v_match_pattern, __pyx_v_full_path); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_40list_match_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_match_pattern, PyObject *__pyx_v_full_path) { + PyObject *__pyx_v_glob = NULL; + PyObject *__pyx_v_filenames = NULL; + PyObject *__pyx_v_filenames_fullpath = NULL; + PyObject *__pyx_v_cwd = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("list_match_files", 0); + + /* "lib/Naked/toolshed/c/system.pyx":374 + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): + * try: # <<<<<<<<<<<<<< + * from glob import glob + * filenames = glob(match_pattern) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":375 + * def list_match_files(match_pattern, full_path = False): + * try: + * from glob import glob # <<<<<<<<<<<<<< + * filenames = glob(match_pattern) + * if full_path: + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_glob); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_glob); + __Pyx_GIVEREF(__pyx_n_s_glob); + __pyx_t_5 = __Pyx_Import(__pyx_n_s_glob, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_glob); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_glob = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":376 + * try: + * from glob import glob + * filenames = glob(match_pattern) # <<<<<<<<<<<<<< + * if full_path: + * filenames_fullpath = [] + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_match_pattern); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_match_pattern); + __Pyx_GIVEREF(__pyx_v_match_pattern); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_glob, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_filenames = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":377 + * from glob import glob + * filenames = glob(match_pattern) + * if full_path: # <<<<<<<<<<<<<< + * filenames_fullpath = [] + * cwd = os.getcwd() + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_full_path); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/system.pyx":378 + * filenames = glob(match_pattern) + * if full_path: + * filenames_fullpath = [] # <<<<<<<<<<<<<< + * cwd = os.getcwd() + * for name in filenames: + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_filenames_fullpath = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":379 + * if full_path: + * filenames_fullpath = [] + * cwd = os.getcwd() # <<<<<<<<<<<<<< + * for name in filenames: + * name = os.path.join(cwd, name) #make the full path to the file + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getcwd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_cwd = __pyx_t_4; + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":380 + * filenames_fullpath = [] + * cwd = os.getcwd() + * for name in filenames: # <<<<<<<<<<<<<< + * name = os.path.join(cwd, name) #make the full path to the file + * filenames_fullpath.append(name) #add to the new list + */ + if (PyList_CheckExact(__pyx_v_filenames) || PyTuple_CheckExact(__pyx_v_filenames)) { + __pyx_t_4 = __pyx_v_filenames; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_filenames); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":381 + * cwd = os.getcwd() + * for name in filenames: + * name = os.path.join(cwd, name) #make the full path to the file # <<<<<<<<<<<<<< + * filenames_fullpath.append(name) #add to the new list + * return filenames_fullpath #then return that list + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_cwd); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_cwd); + __Pyx_GIVEREF(__pyx_v_cwd); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":382 + * for name in filenames: + * name = os.path.join(cwd, name) #make the full path to the file + * filenames_fullpath.append(name) #add to the new list # <<<<<<<<<<<<<< + * return filenames_fullpath #then return that list + * else: + */ + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_filenames_fullpath, __pyx_v_name); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":383 + * name = os.path.join(cwd, name) #make the full path to the file + * filenames_fullpath.append(name) #add to the new list + * return filenames_fullpath #then return that list # <<<<<<<<<<<<<< + * else: + * return filenames + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames_fullpath); + __pyx_r = __pyx_v_filenames_fullpath; + goto __pyx_L7_try_return; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/system.pyx":385 + * return filenames_fullpath #then return that list + * else: + * return filenames # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_filenames); + __pyx_r = __pyx_v_filenames; + goto __pyx_L7_try_return; + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":386 + * else: + * return filenames + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_12) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __pyx_v_e = __pyx_t_10; + + /* "lib/Naked/toolshed/c/system.pyx":387 + * return filenames + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/system.pyx":388 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L16; + } + __pyx_L16:; + + /* "lib/Naked/toolshed/c/system.pyx":389 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.list_match_files", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_glob); + __Pyx_XDECREF(__pyx_v_filenames); + __Pyx_XDECREF(__pyx_v_filenames_fullpath); + __Pyx_XDECREF(__pyx_v_cwd); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_43is_link = {__Pyx_NAMESTR("is_link"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_43is_link(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_link (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_42is_link(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_link", 0); + + /* "lib/Naked/toolshed/c/system.pyx":402 + * #------------------------------------------------------------------------------ + * def is_link(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.islink(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":403 + * def is_link(filepath): + * try: + * return os.path.islink(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_islink); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":404 + * try: + * return os.path.islink(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":405 + * return os.path.islink(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":406 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":407 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.is_link", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_45real_path = {__Pyx_NAMESTR("real_path"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_45real_path(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("real_path (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_44real_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("real_path", 0); + + /* "lib/Naked/toolshed/c/system.pyx":414 + * #------------------------------------------------------------------------------ + * def real_path(filepath): + * try: # <<<<<<<<<<<<<< + * return os.path.realpath(filepath) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":415 + * def real_path(filepath): + * try: + * return os.path.realpath(filepath) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_realpath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_filepath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_filepath); + __Pyx_GIVEREF(__pyx_v_filepath); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":416 + * try: + * return os.path.realpath(filepath) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.real_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":417 + * return os.path.realpath(filepath) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":418 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":419 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.real_path", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_47stdout = {__Pyx_NAMESTR("stdout"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_47stdout(PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(__pyx_self, ((PyObject *)__pyx_v_text)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_46stdout(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout", 0); + + /* "lib/Naked/toolshed/c/system.pyx":432 + * #------------------------------------------------------------------------------ + * def stdout(text): + * try: # <<<<<<<<<<<<<< + * print(text) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":433 + * def stdout(text): + * try: + * print(text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + if (__Pyx_PrintOne(0, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + + /* "lib/Naked/toolshed/c/system.pyx":434 + * try: + * print(text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + */ + __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_4) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":435 + * print(text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":436 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":437 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl = {__Pyx_NAMESTR("stdout_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl(PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout_xnl (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(__pyx_self, ((PyObject *)__pyx_v_text)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_48stdout_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout_xnl", 0); + + /* "lib/Naked/toolshed/c/system.pyx":444 + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): + * try: # <<<<<<<<<<<<<< + * sys.stdout.write(text) + * except Exception as e: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":445 + * def stdout_xnl(text): + * try: + * sys.stdout.write(text) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":446 + * try: + * sys.stdout.write(text) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + */ + __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_7) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":447 + * sys.stdout.write(text) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/system.pyx":448 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/system.pyx":449 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter(PyObject *__pyx_self, PyObject *__pyx_v_iter); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_51stdout_iter = {__Pyx_NAMESTR("stdout_iter"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_51stdout_iter(PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout_iter (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(__pyx_self, ((PyObject *)__pyx_v_iter)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_50stdout_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout_iter", 0); + + /* "lib/Naked/toolshed/c/system.pyx":456 + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): + * try: # <<<<<<<<<<<<<< + * for x in iter: + * stdout(x) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":457 + * def stdout_iter(iter): + * try: + * for x in iter: # <<<<<<<<<<<<<< + * stdout(x) + * except Exception as e: + */ + if (PyList_CheckExact(__pyx_v_iter) || PyTuple_CheckExact(__pyx_v_iter)) { + __pyx_t_4 = __pyx_v_iter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":458 + * try: + * for x in iter: + * stdout(x) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_stdout); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":459 + * for x in iter: + * stdout(x) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/system.pyx":460 + * stdout(x) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":461 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/system.pyx":462 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl(PyObject *__pyx_self, PyObject *__pyx_v_iter); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl = {__Pyx_NAMESTR("stdout_iter_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl(PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stdout_iter_xnl (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(__pyx_self, ((PyObject *)__pyx_v_iter)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_52stdout_iter_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_iter) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stdout_iter_xnl", 0); + + /* "lib/Naked/toolshed/c/system.pyx":470 + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): + * try: # <<<<<<<<<<<<<< + * for x in iter: + * stdout_xnl(x) + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":471 + * def stdout_iter_xnl(iter): + * try: + * for x in iter: # <<<<<<<<<<<<<< + * stdout_xnl(x) + * except Exception as e: + */ + if (PyList_CheckExact(__pyx_v_iter) || PyTuple_CheckExact(__pyx_v_iter)) { + __pyx_t_4 = __pyx_v_iter; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":472 + * try: + * for x in iter: + * stdout_xnl(x) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_stdout_xnl); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":473 + * for x in iter: + * stdout_xnl(x) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + */ + __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_10) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __pyx_v_e = __pyx_t_9; + + /* "lib/Naked/toolshed/c/system.pyx":474 + * stdout_xnl(x) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/system.pyx":475 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_stderr); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L15; + } + __pyx_L15:; + + /* "lib/Naked/toolshed/c/system.pyx":476 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stdout_iter_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_55stderr = {__Pyx_NAMESTR("stderr"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_55stderr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_exit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stderr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_exit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stderr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_text = values[0]; + __pyx_v_exit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stderr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(__pyx_self, __pyx_v_text, __pyx_v_exit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_54stderr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stderr", 0); + + /* "lib/Naked/toolshed/c/system.pyx":484 + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(text + "\n") + * if exit: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":485 + * def stderr(text, exit=0): + * try: + * sys.stderr.write(text + "\n") # <<<<<<<<<<<<<< + * if exit: + * raise SystemExit(exit) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_v_text, __pyx_kp_s__36); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":486 + * try: + * sys.stderr.write(text + "\n") + * if exit: # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exit); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":487 + * sys.stderr.write(text + "\n") + * if exit: + * raise SystemExit(exit) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_exit); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_exit); + __Pyx_GIVEREF(__pyx_v_exit); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":488 + * if exit: + * raise SystemExit(exit) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/system.pyx":489 + * raise SystemExit(exit) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":490 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":491 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl = {__Pyx_NAMESTR("stderr_xnl"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_text = 0; + PyObject *__pyx_v_exit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stderr_xnl (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_text,&__pyx_n_s_exit,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stderr_xnl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_text = values[0]; + __pyx_v_exit = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stderr_xnl", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(__pyx_self, __pyx_v_text, __pyx_v_exit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_56stderr_xnl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text, PyObject *__pyx_v_exit) { + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("stderr_xnl", 0); + + /* "lib/Naked/toolshed/c/system.pyx":498 + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): + * try: # <<<<<<<<<<<<<< + * sys.stderr.write(text) + * if exit: + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/system.pyx":499 + * def stderr_xnl(text, exit=0): + * try: + * sys.stderr.write(text) # <<<<<<<<<<<<<< + * if exit: + * raise SystemExit(exit) + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_text); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text); + __Pyx_GIVEREF(__pyx_v_text); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":500 + * try: + * sys.stderr.write(text) + * if exit: # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * except Exception as e: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_exit); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":501 + * sys.stderr.write(text) + * if exit: + * raise SystemExit(exit) # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_exit); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_exit); + __Pyx_GIVEREF(__pyx_v_exit); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":502 + * if exit: + * raise SystemExit(exit) + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + */ + __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_8) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/system.pyx":503 + * raise SystemExit(exit) + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/system.pyx":504 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stderr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + + /* "lib/Naked/toolshed/c/system.pyx":505 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.stderr_xnl", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_59exit_with_status = {__Pyx_NAMESTR("exit_with_status"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_59exit_with_status(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exit = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("exit_with_status (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exit,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_0); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exit); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exit_with_status") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exit = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("exit_with_status", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_with_status", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(__pyx_self, __pyx_v_exit); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_58exit_with_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exit) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("exit_with_status", 0); + + /* "lib/Naked/toolshed/c/system.pyx":520 + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): + * raise SystemExit(exit) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_exit); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exit); + __Pyx_GIVEREF(__pyx_v_exit); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_with_status", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_61exit_fail = {__Pyx_NAMESTR("exit_fail"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_61exit_fail(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("exit_fail (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_60exit_fail(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("exit_fail", 0); + + /* "lib/Naked/toolshed/c/system.pyx":528 + * #------------------------------------------------------------------------------ + * def exit_fail(): + * raise SystemExit(1) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_fail", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_6system_63exit_success = {__Pyx_NAMESTR("exit_success"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success, METH_NOARGS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_6system_63exit_success(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("exit_success (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_6system_62exit_success(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("exit_success", 0); + + /* "lib/Naked/toolshed/c/system.pyx":536 + * #------------------------------------------------------------------------------ + * def exit_success(): + * raise SystemExit(0) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_SystemExit, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.system.exit_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct__currentdir_to_basefile"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct_1_currentdir_firstparam"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[8]; +static int __pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = 0; + +static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam)))) { + o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[--__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam]; + memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o) { + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_func); + if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam))) { + __pyx_freelist_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam[__pyx_freecount_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o; + if (p->__pyx_v_func) { + e = (*v)(p->__pyx_v_func, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam *)o; + tmp = ((PyObject*)p->__pyx_v_func); + p->__pyx_v_func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("lib.Naked.toolshed.c.system.__pyx_scope_struct_2_currentdir_lastparam"), /*tp_name*/ + sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_traverse*/ + __pyx_tp_clear_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("system"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_EEXIST, __pyx_k_EEXIST, sizeof(__pyx_k_EEXIST), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_Could_not, __pyx_k_Naked_Framework_Error_Could_not, sizeof(__pyx_k_Naked_Framework_Error_Could_not), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with, __pyx_k_Naked_Framework_Error_error_with, sizeof(__pyx_k_Naked_Framework_Error_error_with), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_2, __pyx_k_Naked_Framework_Error_error_with_2, sizeof(__pyx_k_Naked_Framework_Error_error_with_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_3, __pyx_k_Naked_Framework_Error_error_with_3, sizeof(__pyx_k_Naked_Framework_Error_error_with_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_4, __pyx_k_Naked_Framework_Error_error_with_4, sizeof(__pyx_k_Naked_Framework_Error_error_with_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_5, __pyx_k_Naked_Framework_Error_error_with_5, sizeof(__pyx_k_Naked_Framework_Error_error_with_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_6, __pyx_k_Naked_Framework_Error_error_with_6, sizeof(__pyx_k_Naked_Framework_Error_error_with_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_error_with_7, __pyx_k_Naked_Framework_Error_error_with_7, sizeof(__pyx_k_Naked_Framework_Error_error_with_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_10, __pyx_k_Naked_Framework_Error_unable_to_10, sizeof(__pyx_k_Naked_Framework_Error_unable_to_10), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_11, __pyx_k_Naked_Framework_Error_unable_to_11, sizeof(__pyx_k_Naked_Framework_Error_unable_to_11), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_12, __pyx_k_Naked_Framework_Error_unable_to_12, sizeof(__pyx_k_Naked_Framework_Error_unable_to_12), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_13, __pyx_k_Naked_Framework_Error_unable_to_13, sizeof(__pyx_k_Naked_Framework_Error_unable_to_13), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_14, __pyx_k_Naked_Framework_Error_unable_to_14, sizeof(__pyx_k_Naked_Framework_Error_unable_to_14), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_15, __pyx_k_Naked_Framework_Error_unable_to_15, sizeof(__pyx_k_Naked_Framework_Error_unable_to_15), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_16, __pyx_k_Naked_Framework_Error_unable_to_16, sizeof(__pyx_k_Naked_Framework_Error_unable_to_16), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_17, __pyx_k_Naked_Framework_Error_unable_to_17, sizeof(__pyx_k_Naked_Framework_Error_unable_to_17), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_3, __pyx_k_Naked_Framework_Error_unable_to_3, sizeof(__pyx_k_Naked_Framework_Error_unable_to_3), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_4, __pyx_k_Naked_Framework_Error_unable_to_4, sizeof(__pyx_k_Naked_Framework_Error_unable_to_4), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_5, __pyx_k_Naked_Framework_Error_unable_to_5, sizeof(__pyx_k_Naked_Framework_Error_unable_to_5), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_6, __pyx_k_Naked_Framework_Error_unable_to_6, sizeof(__pyx_k_Naked_Framework_Error_unable_to_6), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_7, __pyx_k_Naked_Framework_Error_unable_to_7, sizeof(__pyx_k_Naked_Framework_Error_unable_to_7), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_8, __pyx_k_Naked_Framework_Error_unable_to_8, sizeof(__pyx_k_Naked_Framework_Error_unable_to_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_9, __pyx_k_Naked_Framework_Error_unable_to_9, sizeof(__pyx_k_Naked_Framework_Error_unable_to_9), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1}, + {&__pyx_n_s_SystemExit, __pyx_k_SystemExit, sizeof(__pyx_k_SystemExit), 0, 0, 1, 1}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0}, + {&__pyx_kp_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_basename, __pyx_k_basename, sizeof(__pyx_k_basename), 0, 0, 1, 1}, + {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1}, + {&__pyx_n_s_current_dir, __pyx_k_current_dir, sizeof(__pyx_k_current_dir), 0, 0, 1, 1}, + {&__pyx_n_s_current_directory, __pyx_k_current_directory, sizeof(__pyx_k_current_directory), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_firstparam, __pyx_k_currentdir_firstparam, sizeof(__pyx_k_currentdir_firstparam), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_firstparam_locals_wra, __pyx_k_currentdir_firstparam_locals_wra, sizeof(__pyx_k_currentdir_firstparam_locals_wra), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_lastparam, __pyx_k_currentdir_lastparam, sizeof(__pyx_k_currentdir_lastparam), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_lastparam_locals_wrap, __pyx_k_currentdir_lastparam_locals_wrap, sizeof(__pyx_k_currentdir_lastparam_locals_wrap), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_to_basefile, __pyx_k_currentdir_to_basefile, sizeof(__pyx_k_currentdir_to_basefile), 0, 0, 1, 1}, + {&__pyx_n_s_currentdir_to_basefile_locals_wr, __pyx_k_currentdir_to_basefile_locals_wr, sizeof(__pyx_k_currentdir_to_basefile_locals_wr), 0, 0, 1, 1}, + {&__pyx_n_s_cwd, __pyx_k_cwd, sizeof(__pyx_k_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1}, + {&__pyx_n_s_dir_exists, __pyx_k_dir_exists, sizeof(__pyx_k_dir_exists), 0, 0, 1, 1}, + {&__pyx_n_s_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 0, 1, 1}, + {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, + {&__pyx_n_s_dirpath, __pyx_k_dirpath, sizeof(__pyx_k_dirpath), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_exit_fail, __pyx_k_exit_fail, sizeof(__pyx_k_exit_fail), 0, 0, 1, 1}, + {&__pyx_n_s_exit_success, __pyx_k_exit_success, sizeof(__pyx_k_exit_success), 0, 0, 1, 1}, + {&__pyx_n_s_exit_with_status, __pyx_k_exit_with_status, sizeof(__pyx_k_exit_with_status), 0, 0, 1, 1}, + {&__pyx_n_s_extension_filter, __pyx_k_extension_filter, sizeof(__pyx_k_extension_filter), 0, 0, 1, 1}, + {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, + {&__pyx_n_s_file_exists, __pyx_k_file_exists, sizeof(__pyx_k_file_exists), 0, 0, 1, 1}, + {&__pyx_n_s_file_extension, __pyx_k_file_extension, sizeof(__pyx_k_file_extension), 0, 0, 1, 1}, + {&__pyx_n_s_file_mod_time, __pyx_k_file_mod_time, sizeof(__pyx_k_file_mod_time), 0, 0, 1, 1}, + {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1}, + {&__pyx_n_s_file_size, __pyx_k_file_size, sizeof(__pyx_k_file_size), 0, 0, 1, 1}, + {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, + {&__pyx_n_s_filenames, __pyx_k_filenames, sizeof(__pyx_k_filenames), 0, 0, 1, 1}, + {&__pyx_n_s_filenames_fullpath, __pyx_k_filenames_fullpath, sizeof(__pyx_k_filenames_fullpath), 0, 0, 1, 1}, + {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, + {&__pyx_n_s_full_path, __pyx_k_full_path, sizeof(__pyx_k_full_path), 0, 0, 1, 1}, + {&__pyx_n_s_fullpath, __pyx_k_fullpath, sizeof(__pyx_k_fullpath), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, + {&__pyx_n_s_getcwd, __pyx_k_getcwd, sizeof(__pyx_k_getcwd), 0, 0, 1, 1}, + {&__pyx_n_s_getmtime, __pyx_k_getmtime, sizeof(__pyx_k_getmtime), 0, 0, 1, 1}, + {&__pyx_n_s_getsize, __pyx_k_getsize, sizeof(__pyx_k_getsize), 0, 0, 1, 1}, + {&__pyx_n_s_glob, __pyx_k_glob, sizeof(__pyx_k_glob), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_is_dir, __pyx_k_is_dir, sizeof(__pyx_k_is_dir), 0, 0, 1, 1}, + {&__pyx_n_s_is_file, __pyx_k_is_file, sizeof(__pyx_k_is_file), 0, 0, 1, 1}, + {&__pyx_n_s_is_link, __pyx_k_is_link, sizeof(__pyx_k_is_link), 0, 0, 1, 1}, + {&__pyx_n_s_isdir, __pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 0, 1, 1}, + {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1}, + {&__pyx_n_s_islink, __pyx_k_islink, sizeof(__pyx_k_islink), 0, 0, 1, 1}, + {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_system, __pyx_k_lib_Naked_toolshed_c_system, sizeof(__pyx_k_lib_Naked_toolshed_c_system), 0, 0, 1, 1}, + {&__pyx_n_s_list_all_files, __pyx_k_list_all_files, sizeof(__pyx_k_list_all_files), 0, 0, 1, 1}, + {&__pyx_n_s_list_all_files_cwd, __pyx_k_list_all_files_cwd, sizeof(__pyx_k_list_all_files_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_list_filter_files, __pyx_k_list_filter_files, sizeof(__pyx_k_list_filter_files), 0, 0, 1, 1}, + {&__pyx_n_s_list_filter_files_cwd, __pyx_k_list_filter_files_cwd, sizeof(__pyx_k_list_filter_files_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_list_match_files, __pyx_k_list_match_files, sizeof(__pyx_k_list_match_files), 0, 0, 1, 1}, + {&__pyx_n_s_listdir, __pyx_k_listdir, sizeof(__pyx_k_listdir), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_dirs, __pyx_k_make_dirs, sizeof(__pyx_k_make_dirs), 0, 0, 1, 1}, + {&__pyx_n_s_make_path, __pyx_k_make_path, sizeof(__pyx_k_make_path), 0, 0, 1, 1}, + {&__pyx_n_s_makedirs, __pyx_k_makedirs, sizeof(__pyx_k_makedirs), 0, 0, 1, 1}, + {&__pyx_n_s_match_pattern, __pyx_k_match_pattern, sizeof(__pyx_k_match_pattern), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_ose, __pyx_k_ose, sizeof(__pyx_k_ose), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_path_list, __pyx_k_path_list, sizeof(__pyx_k_path_list), 0, 0, 1, 1}, + {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, + {&__pyx_n_s_real_path, __pyx_k_real_path, sizeof(__pyx_k_real_path), 0, 0, 1, 1}, + {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1}, + {&__pyx_n_s_splitext, __pyx_k_splitext, sizeof(__pyx_k_splitext), 0, 0, 1, 1}, + {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_stderr_xnl, __pyx_k_stderr_xnl, sizeof(__pyx_k_stderr_xnl), 0, 0, 1, 1}, + {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1}, + {&__pyx_n_s_stdout_iter, __pyx_k_stdout_iter, sizeof(__pyx_k_stdout_iter), 0, 0, 1, 1}, + {&__pyx_n_s_stdout_iter_xnl, __pyx_k_stdout_iter_xnl, sizeof(__pyx_k_stdout_iter_xnl), 0, 0, 1, 1}, + {&__pyx_n_s_stdout_xnl, __pyx_k_stdout_xnl, sizeof(__pyx_k_stdout_xnl), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1}, + {&__pyx_n_s_the_cwd, __pyx_k_the_cwd, sizeof(__pyx_k_the_cwd), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1}, + {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_SystemExit = __Pyx_GetBuiltinName(__pyx_n_s_SystemExit); if (!__pyx_builtin_SystemExit) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/system.pyx":25 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/system.pyx":38 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/system.pyx":52 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_3); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/system.pyx":65 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_4); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "lib/Naked/toolshed/c/system.pyx":79 + * + * @wraps(func) + * def wrapper(file_name, *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() #get current working directory path + * full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + */ + __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_file_name, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_current_directory, __pyx_n_s_full_path); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":86 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/system.pyx":99 + * + * @wraps(func) + * def wrapper(dir="", *args, **kwargs): # <<<<<<<<<<<<<< + * current_directory = os.getcwd() + * return func(current_directory, *args, **kwargs) + */ + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_dir, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_current_directory); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__11 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__8)); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "lib/Naked/toolshed/c/system.pyx":105 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "lib/Naked/toolshed/c/system.pyx":121 + * + * @wraps(func) + * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<< + * the_cwd = os.getcwd() + * return func(*args, current_dir=the_cwd) + */ + __pyx_tuple__13 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_the_cwd); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":127 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_3); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/system.pyx":185 + * if ose.errno != errno.EEXIST: # directory already exists + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise ose + * else: + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_Could_not); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/system.pyx":211 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_4); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "lib/Naked/toolshed/c/system.pyx":225 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_5); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "lib/Naked/toolshed/c/system.pyx":241 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_6); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "lib/Naked/toolshed/c/system.pyx":255 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_error_with_7); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "lib/Naked/toolshed/c/system.pyx":274 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_5); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "lib/Naked/toolshed/c/system.pyx":288 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_6); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "lib/Naked/toolshed/c/system.pyx":308 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_7); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "lib/Naked/toolshed/c/system.pyx":320 + * def list_filter_files(extension_filter, dir): + * try: + * if not extension_filter.startswith("."): # <<<<<<<<<<<<<< + * extension_filter = "." + extension_filter + * filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s__24); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "lib/Naked/toolshed/c/system.pyx":326 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_8); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "lib/Naked/toolshed/c/system.pyx":343 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_9); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "lib/Naked/toolshed/c/system.pyx":360 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_10); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "lib/Naked/toolshed/c/system.pyx":388 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_11); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "lib/Naked/toolshed/c/system.pyx":406 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_12); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "lib/Naked/toolshed/c/system.pyx":418 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_13); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "lib/Naked/toolshed/c/system.pyx":436 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_14); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "lib/Naked/toolshed/c/system.pyx":448 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_15); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "lib/Naked/toolshed/c/system.pyx":461 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_16); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "lib/Naked/toolshed/c/system.pyx":475 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_16); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "lib/Naked/toolshed/c/system.pyx":490 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_17); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "lib/Naked/toolshed/c/system.pyx":504 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_17); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "lib/Naked/toolshed/c/system.pyx":528 + * #------------------------------------------------------------------------------ + * def exit_fail(): + * raise SystemExit(1) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "lib/Naked/toolshed/c/system.pyx":536 + * #------------------------------------------------------------------------------ + * def exit_success(): + * raise SystemExit(0) # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_filename, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_extension, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_directory, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_path_list, __pyx_n_s_e); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_path, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_to_basefile, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_firstparam, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_wraps, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_e); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_currentdir_lastparam, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_file_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_fullpath, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_cwd, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_dirpath, __pyx_n_s_os, __pyx_n_s_errno, __pyx_n_s_ose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_make_dirs, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_exists, 203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_file, 220, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_dirpath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_dir_exists, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + __pyx_tuple__67 = PyTuple_Pack(2, __pyx_n_s_dirpath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_dir, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_size, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_filepath, __pyx_n_s_time, __pyx_n_s_e); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_file_mod_time, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_dir, __pyx_n_s_filenames, __pyx_n_s_e, __pyx_n_s_name); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_all_files, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + __pyx_tuple__75 = PyTuple_Pack(5, __pyx_n_s_extension_filter, __pyx_n_s_dir, __pyx_n_s_filenames, __pyx_n_s_e, __pyx_n_s_name); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_filter_files, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_all_files_cwd, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + __pyx_tuple__79 = PyTuple_Pack(3, __pyx_n_s_extension_filter, __pyx_n_s_current_dir, __pyx_n_s_e); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_filter_files_cwd, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + __pyx_tuple__81 = PyTuple_Pack(8, __pyx_n_s_match_pattern, __pyx_n_s_full_path, __pyx_n_s_glob, __pyx_n_s_filenames, __pyx_n_s_filenames_fullpath, __pyx_n_s_cwd, __pyx_n_s_name, __pyx_n_s_e); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_list_match_files, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_is_link, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_filepath, __pyx_n_s_e); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_real_path, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_text, __pyx_n_s_e); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__89); + __Pyx_GIVEREF(__pyx_tuple__89); + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_xnl, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_tuple__91 = PyTuple_Pack(3, __pyx_n_s_iter, __pyx_n_s_x, __pyx_n_s_e); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__91); + __Pyx_GIVEREF(__pyx_tuple__91); + __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_iter, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_iter, __pyx_n_s_x, __pyx_n_s_e); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stdout_iter_xnl, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_exit, __pyx_n_s_e); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stderr, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_text, __pyx_n_s_exit, __pyx_n_s_e); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_stderr_xnl, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_exit); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_with_status, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_fail, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_exit_success, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initsystem(void); /*proto*/ +PyMODINIT_FUNC initsystem(void) +#else +PyMODINIT_FUNC PyInit_system(void); /*proto*/ +PyMODINIT_FUNC PyInit_system(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_system(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("system"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__system) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.system")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.system", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct__currentdir_to_basefile; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_1_currentdir_firstparam; + if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam.tp_print = 0; + __pyx_ptype_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam = &__pyx_type_3lib_5Naked_8toolshed_1c_6system___pyx_scope_struct_2_currentdir_lastparam; + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/system.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * import os + * from Naked.settings import debug as DEBUG_FLAG + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":6 + * + * import sys + * import os # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":7 + * import sys + * import os + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":20 + * # Tests: test_SYSTEM.py :: test_sys_filename + * #------------------------------------------------------------------------------ + * def filename(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.basename(filepath) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_1filename, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_filename, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":33 + * # Tests: test_SYSTEM.py :: test_sys_file_extension + * #------------------------------------------------------------------------------ + * def file_extension(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.splitext(filepath)[1] + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_3file_extension, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_extension, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":47 + * # Tests: test_SYSTEM.py :: test_sys_dir_path + * #------------------------------------------------------------------------------ + * def directory(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.dirname(filepath) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_5directory, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_directory, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":60 + * # Tests: test_SYSTEM.py :: test_sys_make_filepath + * #------------------------------------------------------------------------------ + * def make_path(*path_list): # <<<<<<<<<<<<<< + * try: + * return os.path.join(*path_list) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_7make_path, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_path, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":74 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile + * #------------------------------------------------------------------------------ + * def currentdir_to_basefile(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_9currentdir_to_basefile, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_to_basefile, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":94 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg + * #------------------------------------------------------------------------------ + * def currentdir_firstparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_11currentdir_firstparam, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_firstparam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":116 + * # Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg + * #------------------------------------------------------------------------------ + * def currentdir_lastparam(func): # <<<<<<<<<<<<<< + * try: + * from functools import wraps + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_13currentdir_lastparam, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentdir_lastparam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":138 + * # Tests: test_SYSTEM.py :: test_sys_full_path_to_file + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function # <<<<<<<<<<<<<< + * def fullpath(file_name): + * try: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_to_basefile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/system.pyx":139 + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function + * def fullpath(file_name): # <<<<<<<<<<<<<< + * try: + * return file_name + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_15fullpath, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/system.pyx":138 + * # Tests: test_SYSTEM.py :: test_sys_full_path_to_file + * #------------------------------------------------------------------------------ + * @currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function # <<<<<<<<<<<<<< + * def fullpath(file_name): + * try: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_fullpath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":155 + * # Tests: test_SYSTEM.py :: test_sys_cwd_path + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def cwd(dir=""): + * try: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_firstparam); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/system.pyx":156 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return dir + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_17cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/system.pyx":155 + * # Tests: test_SYSTEM.py :: test_sys_cwd_path + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def cwd(dir=""): + * try: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cwd, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":176 + * # DOES NOT already exist + * #------------------------------------------------------------------------------ + * def make_dirs(dirpath): # <<<<<<<<<<<<<< + * try: + * import os + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_19make_dirs, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_dirs, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":203 + * # Tests: test_SYSTEM.py :: test_file_exists + * #------------------------------------------------------------------------------ + * def file_exists(filepath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_21file_exists, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_exists, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":220 + * # test_sys_is_file_when_dir + * #------------------------------------------------------------------------------ + * def is_file(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.isfile(filepath) + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_23is_file, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_file, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":233 + * # Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir + * #------------------------------------------------------------------------------ + * def dir_exists(dirpath): # <<<<<<<<<<<<<< + * try: + * if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_25dir_exists, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dir_exists, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":250 + * # test_sys_dir_is_dir_when_missing + * #------------------------------------------------------------------------------ + * def is_dir(dirpath): # <<<<<<<<<<<<<< + * try: + * return os.path.isdir(dirpath) + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_27is_dir, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_dir, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":269 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_size + * #------------------------------------------------------------------------------ + * def file_size(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.getsize(filepath) + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_29file_size, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":282 + * # Tests: test_SYSTEM.py :: test_sys_meta_file_mod + * #------------------------------------------------------------------------------ + * def file_mod_time(filepath): # <<<<<<<<<<<<<< + * try: + * import time + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_31file_mod_time, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_mod_time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":302 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir + * #------------------------------------------------------------------------------ + * def list_all_files(dir): # <<<<<<<<<<<<<< + * try: + * filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_33list_all_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_all_files, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":318 + * # Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch + * #------------------------------------------------------------------------------ + * def list_filter_files(extension_filter, dir): # <<<<<<<<<<<<<< + * try: + * if not extension_filter.startswith("."): + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_35list_filter_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_filter_files, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":337 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def list_all_files_cwd(dir=""): + * try: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_firstparam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/system.pyx":338 + * #------------------------------------------------------------------------------ + * @currentdir_firstparam + * def list_all_files_cwd(dir=""): # <<<<<<<<<<<<<< + * try: + * return list_all_files(dir) + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_37list_all_files_cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/system.pyx":337 + * # Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd + * #------------------------------------------------------------------------------ + * @currentdir_firstparam # <<<<<<<<<<<<<< + * def list_all_files_cwd(dir=""): + * try: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_all_files_cwd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":354 + * # Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch + * #------------------------------------------------------------------------------ + * @currentdir_lastparam # <<<<<<<<<<<<<< + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_currentdir_lastparam); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/system.pyx":355 + * #------------------------------------------------------------------------------ + * @currentdir_lastparam + * def list_filter_files_cwd(extension_filter, current_dir=""): # <<<<<<<<<<<<<< + * try: + * return list_filter_files(extension_filter, current_dir) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_39list_filter_files_cwd, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/system.pyx":354 + * # Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch + * #------------------------------------------------------------------------------ + * @currentdir_lastparam # <<<<<<<<<<<<<< + * def list_filter_files_cwd(extension_filter, current_dir=""): + * try: + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_filter_files_cwd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":373 + * # Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath + * #------------------------------------------------------------------------------ + * def list_match_files(match_pattern, full_path = False): # <<<<<<<<<<<<<< + * try: + * from glob import glob + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_41list_match_files, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_match_files, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":401 + * # return boolean indicating whether the path is a symbolic link + * #------------------------------------------------------------------------------ + * def is_link(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.islink(filepath) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_43is_link, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_link, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":413 + * # return the real file path pointed to by a symbolic link + * #------------------------------------------------------------------------------ + * def real_path(filepath): # <<<<<<<<<<<<<< + * try: + * return os.path.realpath(filepath) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_45real_path, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_real_path, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":431 + * # print to std output stream + * #------------------------------------------------------------------------------ + * def stdout(text): # <<<<<<<<<<<<<< + * try: + * print(text) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_47stdout, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":443 + * # print to std output stream without a newline + * #------------------------------------------------------------------------------ + * def stdout_xnl(text): # <<<<<<<<<<<<<< + * try: + * sys.stdout.write(text) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_49stdout_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":455 + * # print items in an iterable to the standard output stream with newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_51stdout_iter, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_iter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":469 + * # print items in an iterable to the standard output stream without newlines after each string + * #------------------------------------------------------------------------------ + * def stdout_iter_xnl(iter): # <<<<<<<<<<<<<< + * try: + * for x in iter: + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_53stdout_iter_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stdout_iter_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":483 + * # optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code + * #------------------------------------------------------------------------------ + * def stderr(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text + "\n") + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_55stderr, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stderr, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":497 + * # print to the standard error stream without a newline character after the `text` string + * #------------------------------------------------------------------------------ + * def stderr_xnl(text, exit=0): # <<<<<<<<<<<<<< + * try: + * sys.stderr.write(text) + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_57stderr_xnl, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_stderr_xnl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":519 + * # Tests: test_SYSTEM.py :: test_sys_exit_with_code + * #------------------------------------------------------------------------------ + * def exit_with_status(exit=0): # <<<<<<<<<<<<<< + * raise SystemExit(exit) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_59exit_with_status, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_with_status, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":527 + * # Tests: test_SYSTEM.py :: test_sys_exit_failure + * #------------------------------------------------------------------------------ + * def exit_fail(): # <<<<<<<<<<<<<< + * raise SystemExit(1) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_61exit_fail, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_fail, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":535 + * # Tests: test_SYSTEM.py :: test_sys_exit_success + * #------------------------------------------------------------------------------ + * def exit_success(): # <<<<<<<<<<<<<< + * raise SystemExit(0) + * + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_6system_63exit_success, NULL, __pyx_n_s_lib_Naked_toolshed_c_system); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_exit_success, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/system.pyx":540 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # #------------------------------------------------------------------------------ + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/system.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.system", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.system"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CPYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { + PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static PyObject *__Pyx_GetStdout(void) { + PyObject *f = PySys_GetObject((char *)"stdout"); + if (!f) { + PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); + } + return f; +} +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { + int i; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { + PyObject* v; + if (PyFile_SoftSpace(f, 1)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + v = PyTuple_GET_ITEM(arg_tuple, i); + if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) + goto error; + if (PyString_Check(v)) { + char *s = PyString_AsString(v); + Py_ssize_t len = PyString_Size(v); + if (len > 0) { + switch (s[len-1]) { + case ' ': break; + case '\f': case '\r': case '\n': case '\t': case '\v': + PyFile_SoftSpace(f, 0); + break; + default: break; + } + } + } + } + if (newline) { + if (PyFile_WriteString("\n", f) < 0) + goto error; + PyFile_SoftSpace(f, 0); + } + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; +} +#else /* Python 3 has a print function */ +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { + PyObject* kwargs = 0; + PyObject* result = 0; + PyObject* end_string; + if (unlikely(!__pyx_print)) { + __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); + if (!__pyx_print) + return -1; + } + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { + __pyx_print_kwargs = PyDict_New(); + if (unlikely(!__pyx_print_kwargs)) + return -1; + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + return -1; + if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { + Py_DECREF(end_string); + return -1; + } + Py_DECREF(end_string); + } + kwargs = __pyx_print_kwargs; + } + result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); + if (!result) + return -1; + Py_DECREF(result); + return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; +} +#endif + +#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } + Py_INCREF(f); + if (PyFile_SoftSpace(f, 0)) { + if (PyFile_WriteString(" ", f) < 0) + goto error; + } + if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) + goto error; + if (PyFile_WriteString("\n", f) < 0) + goto error; + Py_DECREF(f); + return 0; +error: + Py_DECREF(f); + return -1; + /* the line below is just to avoid C compiler + * warnings about unused functions */ + return __Pyx_Print(f, NULL, 0); +} +#else /* Python 3 has a print function */ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { + int res; + PyObject* arg_tuple = PyTuple_Pack(1, o); + if (unlikely(!arg_tuple)) + return -1; + res = __Pyx_Print(stream, arg_tuple, 1); + Py_DECREF(arg_tuple); + return res; +} +#endif + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.pyx new file mode 100644 index 00000000..3c11a5da --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/system.pyx @@ -0,0 +1,554 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +import os +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY PATHS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filename function ] (string) +# returns file name from a file path (including the file extension) +# Tests: test_SYSTEM.py :: test_sys_filename +#------------------------------------------------------------------------------ +def filename(filepath): + try: + return os.path.basename(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_extension function ] (string) +# returns file extension from a filepath +# Tests: test_SYSTEM.py :: test_sys_file_extension +#------------------------------------------------------------------------------ +def file_extension(filepath): + try: + return os.path.splitext(filepath)[1] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ directory function ] (string) +# returns directory path to the filepath +# Tests: test_SYSTEM.py :: test_sys_dir_path +#------------------------------------------------------------------------------ +def directory(filepath): + try: + return os.path.dirname(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ make_path function ] (string) +# returns OS independent file path from tuple of path components +# Tests: test_SYSTEM.py :: test_sys_make_filepath +#------------------------------------------------------------------------------ +def make_path(*path_list): + try: + return os.path.join(*path_list) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_to_basefile decorator function ] (returns decorated original function) +# concatenates the absolute working directory path to the basename of file in the first parameter of the undecorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile +#------------------------------------------------------------------------------ +def currentdir_to_basefile(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(file_name, *args, **kwargs): + current_directory = os.getcwd() #get current working directory path + full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ currentdir_firstparam decorator function ] (returns decorated original function) +# adds the current working directory as the first function parameter of the decorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg +#------------------------------------------------------------------------------ +def currentdir_firstparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(dir="", *args, **kwargs): + current_directory = os.getcwd() + return func(current_directory, *args, **kwargs) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_lastargument decorator function ] (returns decorated original function) +# adds the current working directory as the last function parameter of the decorated function +# Note: you cannot use other named arguments in the original function with this decorator +# Note: the current directory argument in the last position must be named current_dir +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg +#------------------------------------------------------------------------------ +def currentdir_lastparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(*args, **kwargs): + the_cwd = os.getcwd() + return func(*args, current_dir=the_cwd) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ fullpath function ] (string) +# returns the absolute path to a file that is in the current working directory +# file_name = the basename of the file in the current working directory +# Example usage where test.txt is in working directory: +# filepath = fullpath("test.txt") +# Tests: test_SYSTEM.py :: test_sys_full_path_to_file +#------------------------------------------------------------------------------ +@currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function +def fullpath(file_name): + try: + return file_name + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return absolute path to the file with the fullpath() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ cwd function ] (string) +# returns the current working directory path +# does not need to be called with an argument, the decorator assigns it +# Example usage: +# current_dir = cwd() +# Tests: test_SYSTEM.py :: test_sys_cwd_path +#------------------------------------------------------------------------------ +@currentdir_firstparam +def cwd(dir=""): + try: + return dir + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the current working directory with the cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DIRECTORY WRITES +# +#------------------------------------------------------------------------------ + +## TODO: add tests +#------------------------------------------------------------------------------ +# [ make_dirs function ] (--none--) +# make a new directory path (recursive if multiple levels of depth) if it +# DOES NOT already exist +#------------------------------------------------------------------------------ +def make_dirs(dirpath): + try: + import os + import errno + os.makedirs(dirpath) + return True + except OSError as ose: + if ose.errno != errno.EEXIST: # directory already exists + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + raise ose + else: + return False + except Exception as e: + raise e + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ file_exists function ] (boolean) +# return boolean for existence of file in specified path +# Tests: test_SYSTEM.py :: test_file_exists +#------------------------------------------------------------------------------ +def file_exists(filepath): + try: + if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_file function ] (boolean) +# returns boolean for determination of whether filepath is a file +# Tests: test_SYSTEM.py :: test_sys_is_file, test_sys_is_file_missing_file, +# test_sys_is_file_when_dir +#------------------------------------------------------------------------------ +def is_file(filepath): + try: + return os.path.isfile(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ dir_exists function ] (boolean) +# return boolean for existence of directory in specified path +# Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir +#------------------------------------------------------------------------------ +def dir_exists(dirpath): + try: + if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_dir function ] (boolean) +# returns boolean for determination of whether dirpath is a directory +# Tests: test_SYSTEM.py :: test_sys_dir_is_dir, test_sys_dir_is_dir_when_file, +# test_sys_dir_is_dir_when_missing +#------------------------------------------------------------------------------ +def is_dir(dirpath): + try: + return os.path.isdir(dirpath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE METADATA +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filesize function ] (int) +# return file size in bytes +# Tests: test_SYSTEM.py :: test_sys_meta_file_size +#------------------------------------------------------------------------------ +def file_size(filepath): + try: + return os.path.getsize(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_mod_time function ] (string) +# return the last file modification date/time +# Tests: test_SYSTEM.py :: test_sys_meta_file_mod +#------------------------------------------------------------------------------ +def file_mod_time(filepath): + try: + import time + return time.ctime(os.path.getmtime(filepath)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE LISTINGS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ list_all_files function ] (list) +# returns a list of all files in developer specified directory +# Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir +#------------------------------------------------------------------------------ +def list_all_files(dir): + try: + filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files function ] (list) +# returns a list of files filtered by developer defined file extension in developer defined directory +# Usage example: +# filenames = list_filter_files("py", "tests") +# Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch +#------------------------------------------------------------------------------ +def list_filter_files(extension_filter, dir): + try: + if not extension_filter.startswith("."): + extension_filter = "." + extension_filter + filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_all_files_cwd function ] (list) +# returns a list of all files in the current working directory +# Note: does not require argument, the decorator assigns the cwd +# Usage example: +# file_list = list_all_files_cwd() +# Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd +#------------------------------------------------------------------------------ +@currentdir_firstparam +def list_all_files_cwd(dir=""): + try: + return list_all_files(dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files_cwd function ] (list) +# returns a list of all files in the current working directory filtered by developer specified file extension +# Note: do not specify the second argument, decorator assigns it +# Usage example: +# file_list = list_filter_files_cwd(".py") +# Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch +#------------------------------------------------------------------------------ +@currentdir_lastparam +def list_filter_files_cwd(extension_filter, current_dir=""): + try: + return list_filter_files(extension_filter, current_dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ list_match_files function ] (list) +# returns a list of all files that match the developer specified wildcard match pattern +# can optionally specify return of full path to the files (rather than relative path from cwd) by setting full_path to True +# Usage examples: +# file_list = list_match_files("*.py") +# file_list_fullpath = list_match_files("*.py", True) +# Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath +#------------------------------------------------------------------------------ +def list_match_files(match_pattern, full_path = False): + try: + from glob import glob + filenames = glob(match_pattern) + if full_path: + filenames_fullpath = [] + cwd = os.getcwd() + for name in filenames: + name = os.path.join(cwd, name) #make the full path to the file + filenames_fullpath.append(name) #add to the new list + return filenames_fullpath #then return that list + else: + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# SYMBOLIC LINK TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ is_link function ] (boolean) +# return boolean indicating whether the path is a symbolic link +#------------------------------------------------------------------------------ +def is_link(filepath): + try: + return os.path.islink(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ real_path function ] (string) +# return the real file path pointed to by a symbolic link +#------------------------------------------------------------------------------ +def real_path(filepath): + try: + return os.path.realpath(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DATA STREAMS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ stdout function ] +# print to std output stream +#------------------------------------------------------------------------------ +def stdout(text): + try: + print(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_xnl function ] +# print to std output stream without a newline +#------------------------------------------------------------------------------ +def stdout_xnl(text): + try: + sys.stdout.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_iter function ] +# print items in an iterable to the standard output stream with newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter(iter): + try: + for x in iter: + stdout(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ stdout_iter_xnl function ] +# print items in an iterable to the standard output stream without newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter_xnl(iter): + try: + for x in iter: + stdout_xnl(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr function ] +# print to std error stream +# optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code +#------------------------------------------------------------------------------ +def stderr(text, exit=0): + try: + sys.stderr.write(text + "\n") + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr_xnl function ] +# print to the standard error stream without a newline character after the `text` string +#------------------------------------------------------------------------------ +def stderr_xnl(text, exit=0): + try: + sys.stderr.write(text) + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# APPLICATION CONTROL +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ exit_with_status function ] +# application exit with developer specified exit status code (default = 0) +# use an exit status integer argument +# Tests: test_SYSTEM.py :: test_sys_exit_with_code +#------------------------------------------------------------------------------ +def exit_with_status(exit=0): + raise SystemExit(exit) + +#------------------------------------------------------------------------------ +# [ exit_fail function ] +# application exit with status code 1 +# Tests: test_SYSTEM.py :: test_sys_exit_failure +#------------------------------------------------------------------------------ +def exit_fail(): + raise SystemExit(1) + +#------------------------------------------------------------------------------ +# [ exit_success function] +# application exit with status code 0 +# Tests: test_SYSTEM.py :: test_sys_exit_success +#------------------------------------------------------------------------------ +def exit_success(): + raise SystemExit(0) + + + +if __name__ == '__main__': + pass + # #------------------------------------------------------------------------------ + # # Standard Output Tests + # #------------------------------------------------------------------------------ + # stdout("This is a test") + # for x in range(10): + # stdout_xnl(str(x) + " ") + # list_ten = ['10% ', '20% ', '30% ', '40% ', '50% ', '60% ', '70% ', '80% ', '90% ', '100%'] + # stdout_iter(list_ten) + # #------------------------------------------------------------------------------ + # # Standard Error Tests + # #------------------------------------------------------------------------------ + # stderr("This is a test") + # stderr("This is a test", 1) #exit with status code 1 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.c b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.c new file mode 100644 index 00000000..2c314d35 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.c @@ -0,0 +1,24613 @@ +/* Generated by Cython 0.20.1 on Sun Mar 16 22:58:16 2014 */ + +#define PY_SSIZE_T_CLEAN +#ifndef CYTHON_USE_PYLONG_INTERNALS +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 0 +#else +#include "pyconfig.h" +#ifdef PYLONG_BITS_IN_DIGIT +#define CYTHON_USE_PYLONG_INTERNALS 1 +#else +#define CYTHON_USE_PYLONG_INTERNALS 0 +#endif +#endif +#endif +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02040000 + #error Cython requires Python 2.4+. +#else +#define CYTHON_ABI "0_20_1" +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION +#define CYTHON_COMPILING_IN_PYPY 1 +#define CYTHON_COMPILING_IN_CPYTHON 0 +#else +#define CYTHON_COMPILING_IN_PYPY 0 +#define CYTHON_COMPILING_IN_CPYTHON 1 +#endif +#if CYTHON_COMPILING_IN_PYPY +#define Py_OptimizeFlag 0 +#endif +#if PY_VERSION_HEX < 0x02050000 + typedef int Py_ssize_t; + #define PY_SSIZE_T_MAX INT_MAX + #define PY_SSIZE_T_MIN INT_MIN + #define PY_FORMAT_SIZE_T "" + #define CYTHON_FORMAT_SSIZE_T "" + #define PyInt_FromSsize_t(z) PyInt_FromLong(z) + #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) + #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ + (PyErr_Format(PyExc_TypeError, \ + "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ + (PyObject*)0)) + #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ + !PyComplex_Check(o)) + #define PyIndex_Check __Pyx_PyIndex_Check + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) + #define __PYX_BUILD_PY_SSIZE_T "i" +#else + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" + #define __Pyx_PyIndex_Check PyIndex_Check +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) + #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) + #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) + #define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, + #define PyType_Modified(t) + typedef struct { + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; + } Py_buffer; + #define PyBUF_SIMPLE 0 + #define PyBUF_WRITABLE 0x0001 + #define PyBUF_FORMAT 0x0004 + #define PyBUF_ND 0x0008 + #define PyBUF_STRIDES (0x0010 | PyBUF_ND) + #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) + #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) + #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) + #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) + #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) + #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) + typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); + typedef void (*releasebufferproc)(PyObject *, Py_buffer *); +#endif +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") +#endif +#if PY_MAJOR_VERSION >= 3 + #define Py_TPFLAGS_CHECKTYPES 0 + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#if PY_VERSION_HEX < 0x02060000 + #define Py_TPFLAGS_HAVE_VERSION_TAG 0 +#endif +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) + #define Py_TPFLAGS_IS_ABSTRACT 0 +#endif +#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) +#else + #define CYTHON_PEP393_ENABLED 0 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject + #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check + #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ + PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) +#else + #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) + #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) + #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) +#endif +#if PY_VERSION_HEX < 0x02050000 + #define __Pyx_NAMESTR(n) ((char *)(n)) + #define __Pyx_DOCSTR(n) ((char *)(n)) +#else + #define __Pyx_NAMESTR(n) (n) + #define __Pyx_DOCSTR(n) (n) +#endif +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and + a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is + a quiet NaN. */ + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif + + +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif +#include +#define __PYX_HAVE__lib__Naked__toolshed__c__types +#define __PYX_HAVE_API__lib__Naked__toolshed__c__types +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ + (sizeof(type) < sizeof(Py_ssize_t)) || \ + (sizeof(type) > sizeof(Py_ssize_t) && \ + likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX) && \ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ + v == (type)PY_SSIZE_T_MIN))) || \ + (sizeof(type) == sizeof(Py_ssize_t) && \ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) +#if PY_MAJOR_VERSION < 3 +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +{ + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return u_end - u - 1; +} +#else +#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +#endif +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) +#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_COMPILING_IN_CPYTHON +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (ascii_chars_u == NULL) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + } + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys = NULL; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (sys == NULL) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ + +static PyObject *__pyx_m; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "types.pyx", +}; + +/*--- Type declarations ---*/ +struct __pyx_defaults; +typedef struct __pyx_defaults __pyx_defaults; +struct __pyx_defaults1; +typedef struct __pyx_defaults1 __pyx_defaults1; +struct __pyx_defaults2; +typedef struct __pyx_defaults2 __pyx_defaults2; +struct __pyx_defaults3; +typedef struct __pyx_defaults3 __pyx_defaults3; +struct __pyx_defaults4; +typedef struct __pyx_defaults4 __pyx_defaults4; +struct __pyx_defaults5; +typedef struct __pyx_defaults5 __pyx_defaults5; +struct __pyx_defaults6; +typedef struct __pyx_defaults6 __pyx_defaults6; +struct __pyx_defaults7; +typedef struct __pyx_defaults7 __pyx_defaults7; +struct __pyx_defaults8; +typedef struct __pyx_defaults8 __pyx_defaults8; +struct __pyx_defaults9; +typedef struct __pyx_defaults9 __pyx_defaults9; +struct __pyx_defaults10; +typedef struct __pyx_defaults10 __pyx_defaults10; +struct __pyx_defaults11; +typedef struct __pyx_defaults11 __pyx_defaults11; +struct __pyx_defaults12; +typedef struct __pyx_defaults12 __pyx_defaults12; +struct __pyx_defaults { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults1 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults2 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults3 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults4 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults5 { + PyObject *__pyx_arg_initial_iterable; + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults6 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults7 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults8 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults9 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults10 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults11 { + PyObject *__pyx_arg_attributes; +}; +struct __pyx_defaults12 { + PyObject *__pyx_arg_attributes; +}; +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + if (acquire_gil) { \ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + PyGILState_Release(__pyx_gilstate_save); \ + } else { \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil) \ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext() \ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif /* CYTHON_REFNANNY */ +#define __Pyx_XDECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_XDECREF(tmp); \ + } while (0) +#define __Pyx_DECREF_SET(r, v) do { \ + PyObject *tmp = (PyObject *) r; \ + r = v; __Pyx_DECREF(tmp); \ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ + +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ + +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ + const char* function_name); /*proto*/ + +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ + +#include + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ + +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +#if PY_VERSION_HEX < 0x02050000 +#ifndef PyAnySet_CheckExact +#define PyAnySet_CheckExact(ob) \ + ((ob)->ob_type == &PySet_Type || \ + (ob)->ob_type == &PyFrozenSet_Type) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) +#define Pyx_PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) +#define PySet_Size(anyset) \ + PyObject_Size((anyset)) +#define PySet_Contains(anyset, key) \ + PySequence_Contains((anyset), (key)) +#define PySet_Pop(set) \ + PyObject_CallMethod((set), (char*)"pop", NULL) +static CYTHON_INLINE int PySet_Clear(PyObject *set) { + PyObject *ret = PyObject_CallMethod(set, (char*)"clear", NULL); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"discard", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { + PyObject *ret = PyObject_CallMethod(set, (char*)"add", (char*)"(O)", key); + if (!ret) return -1; + Py_DECREF(ret); return 0; +} +#endif /* PyAnySet_CheckExact (<= Py2.4) */ +#endif /* < Py2.5 */ + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ + +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/ +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +#define __Pyx_CyFunction_USED 1 +#include +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f) \ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f) \ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f) \ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; + PyObject *func_dict; + PyObject *func_weakreflist; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; /* No-args super() class cell */ + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; /* Const defaults tuple */ + PyObject *defaults_kwdict; /* Const kwonly defaults dict */ + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; /* function annotations dict */ +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __Pyx_CyFunction_init(void); + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +static int __Pyx_check_binary_version(void); + +typedef struct { + int code_line; + PyCodeObject* code_object; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); /*proto*/ + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ + + +/* Module declarations from 'lib.Naked.toolshed.c.types' */ +#define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.types" +int __pyx_module_is_main_lib__Naked__toolshed__c__types = 0; + +/* Implementation of 'lib.Naked.toolshed.c.types' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_Exception; +static PyObject *__pyx_builtin_max; +static PyObject *__pyx_builtin_zip; +static PyObject *__pyx_builtin_min; +static PyObject *__pyx_builtin_sum; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_4_equal_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_6_equal_attributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_12equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_14type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dict_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_12conditional_map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_14map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_16val_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_18max_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_20min_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_22sum_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_24val_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_26val_count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_28difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_30intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_32key_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_34random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_36random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_38xitems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_lists); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_12join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_separator); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_14postfix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_after); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_16prefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_18surround(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before, PyObject *__pyx_v_after); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_20max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_22min(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_24sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_26count_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_28remove_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_30difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_32intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_34map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_36conditional_map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_38count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_test_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_40random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_42random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_44shuffle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_46wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_48multi_wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcards); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_50xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_52xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_54xtuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_initial_iterable, PyObject *__pyx_v_attributes, PyObject *__pyx_v_max_length, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_2__lshift__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_6xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_8xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_set, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_4xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_6xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_8type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_6concat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_strings); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_substring); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_10xsplit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_12xsplit_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_14begins(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_begin_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_16ends(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_end_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_18wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_20unicode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, CYTHON_UNUSED PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_6__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_attribute); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__cmp__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_string); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_10_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_12type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_tuple, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static char __pyx_k_e[] = "e"; +static char __pyx_k_x[] = "x"; +static char __pyx_k__5[] = ""; +static char __pyx_k__6[] = "|"; +static char __pyx_k__8[] = "["; +static char __pyx_k__9[] = "]"; +static char __pyx_k_eq[] = "__eq__"; +static char __pyx_k_ne[] = "__ne__"; +static char __pyx_k_re[] = "re"; +static char __pyx_k_wc[] = "wc"; +static char __pyx_k_add[] = "__add__"; +static char __pyx_k_cls[] = "cls"; +static char __pyx_k_cmp[] = "__cmp__"; +static char __pyx_k_doc[] = "__doc__"; +static char __pyx_k_key[] = "key"; +static char __pyx_k_len[] = "__len__"; +static char __pyx_k_max[] = "max"; +static char __pyx_k_min[] = "min"; +static char __pyx_k_new[] = "__new__"; +static char __pyx_k_obj[] = "obj"; +static char __pyx_k_pop[] = "pop"; +static char __pyx_k_str[] = "__str__"; +static char __pyx_k_sum[] = "sum"; +static char __pyx_k_sys[] = "sys"; +static char __pyx_k_zip[] = "zip"; +static char __pyx_k_NFKD[] = "NFKD"; +static char __pyx_k_XSet[] = "XSet"; +static char __pyx_k_dict[] = "__dict__"; +static char __pyx_k_ends[] = "ends"; +static char __pyx_k_iadd[] = "__iadd__"; +static char __pyx_k_init[] = "__init__"; +static char __pyx_k_item[] = "item"; +static char __pyx_k_join[] = "join"; +static char __pyx_k_keys[] = "keys"; +static char __pyx_k_main[] = "__main__"; +static char __pyx_k_name[] = "__name__"; +static char __pyx_k_push[] = "push"; +static char __pyx_k_repr[] = "__repr__"; +static char __pyx_k_self[] = "self"; +static char __pyx_k_test[] = "__test__"; +static char __pyx_k_type[] = "type"; +static char __pyx_k_xset[] = "xset"; +static char __pyx_k_UTF_8[] = "UTF-8"; +static char __pyx_k_XDict[] = "XDict"; +static char __pyx_k_XFSet[] = "XFSet"; +static char __pyx_k_XList[] = "XList"; +static char __pyx_k_after[] = "after"; +static char __pyx_k_count[] = "count"; +static char __pyx_k_debug[] = "debug"; +static char __pyx_k_deque[] = "deque"; +static char __pyx_k_heapq[] = "heapq"; +static char __pyx_k_index[] = "_index"; +static char __pyx_k_items[] = "items"; +static char __pyx_k_lower[] = "lower"; +static char __pyx_k_queue[] = "_queue"; +static char __pyx_k_split[] = "split"; +static char __pyx_k_utf_8[] = "utf-8"; +static char __pyx_k_value[] = "value"; +static char __pyx_k_write[] = "write"; +static char __pyx_k_xfset[] = "xfset"; +static char __pyx_k_xlist[] = "xlist"; +static char __pyx_k_XQueue[] = "XQueue"; +static char __pyx_k_XTuple[] = "XTuple"; +static char __pyx_k_before[] = "before"; +static char __pyx_k_begins[] = "begins"; +static char __pyx_k_choice[] = "choice"; +static char __pyx_k_concat[] = "concat"; +static char __pyx_k_decode[] = "decode"; +static char __pyx_k_delim2[] = "delim2"; +static char __pyx_k_encode[] = "encode"; +static char __pyx_k_equals[] = "equals"; +static char __pyx_k_extend[] = "extend"; +static char __pyx_k_import[] = "__import__"; +static char __pyx_k_length[] = "length"; +static char __pyx_k_lshift[] = "__lshift__"; +static char __pyx_k_module[] = "__module__"; +static char __pyx_k_object[] = "object"; +static char __pyx_k_prefix[] = "prefix"; +static char __pyx_k_random[] = "random"; +static char __pyx_k_result[] = "result"; +static char __pyx_k_sample[] = "sample"; +static char __pyx_k_stderr[] = "stderr"; +static char __pyx_k_update[] = "update"; +static char __pyx_k_values[] = "values"; +static char __pyx_k_xitems[] = "xitems"; +static char __pyx_k_xsplit[] = "xsplit"; +static char __pyx_k_xtuple[] = "xtuple"; +static char __pyx_k_XString[] = "XString"; +static char __pyx_k_fnmatch[] = "fnmatch"; +static char __pyx_k_getattr[] = "__getattr__"; +static char __pyx_k_heappop[] = "heappop"; +static char __pyx_k_index_2[] = "index"; +static char __pyx_k_max_val[] = "max_val"; +static char __pyx_k_min_val[] = "min_val"; +static char __pyx_k_postfix[] = "postfix"; +static char __pyx_k_prepare[] = "__prepare__"; +static char __pyx_k_pushpop[] = "pushpop"; +static char __pyx_k_set_obj[] = "set_obj"; +static char __pyx_k_shuffle[] = "shuffle"; +static char __pyx_k_str_obj[] = "str_obj"; +static char __pyx_k_strings[] = "strings"; +static char __pyx_k_subitem[] = "subitem"; +static char __pyx_k_the_key[] = "the_key"; +static char __pyx_k_the_set[] = "the_set"; +static char __pyx_k_tup_obj[] = "tup_obj"; +static char __pyx_k_unicode[] = "unicode"; +static char __pyx_k_wc_list[] = "wc_list"; +static char __pyx_k_XMaxHeap[] = "XMaxHeap"; +static char __pyx_k_XMinHeap[] = "XMinHeap"; +static char __pyx_k_XUnicode[] = "XUnicode"; +static char __pyx_k_contains[] = "contains"; +static char __pyx_k_count_ci[] = "count_ci"; +static char __pyx_k_dict_obj[] = "dict_obj"; +static char __pyx_k_heappush[] = "heappush"; +static char __pyx_k_list_obj[] = "list_obj"; +static char __pyx_k_new_dict[] = "new_dict"; +static char __pyx_k_priority[] = "priority"; +static char __pyx_k_qualname[] = "__qualname__"; +static char __pyx_k_str_list[] = "str_list"; +static char __pyx_k_sum_vals[] = "sum_vals"; +static char __pyx_k_surround[] = "surround"; +static char __pyx_k_the_list[] = "the_list"; +static char __pyx_k_wildcard[] = "wildcard"; +static char __pyx_k_Exception[] = "Exception"; +static char __pyx_k_XList_max[] = "XList.max"; +static char __pyx_k_XList_min[] = "XList.min"; +static char __pyx_k_XList_sum[] = "XList.sum"; +static char __pyx_k_XUnicode2[] = "XUnicode2"; +static char __pyx_k_XUnicode3[] = "XUnicode3"; +static char __pyx_k_attr_dict[] = "attr_dict"; +static char __pyx_k_enumerate[] = "enumerate"; +static char __pyx_k_iteritems[] = "iteritems"; +static char __pyx_k_key_xlist[] = "key_xlist"; +static char __pyx_k_metaclass[] = "__metaclass__"; +static char __pyx_k_norm_text[] = "norm_text"; +static char __pyx_k_normalize[] = "normalize"; +static char __pyx_k_other_obj[] = "other_obj"; +static char __pyx_k_separator[] = "separator"; +static char __pyx_k_substring[] = "substring"; +static char __pyx_k_temp_list[] = "temp_list"; +static char __pyx_k_the_tuple[] = "the_tuple"; +static char __pyx_k_val_count[] = "val_count"; +static char __pyx_k_val_xlist[] = "val_xlist"; +static char __pyx_k_wildcards[] = "wildcards"; +static char __pyx_k_DEBUG_FLAG[] = "DEBUG_FLAG"; +static char __pyx_k_XDict___eq[] = "XDict.__eq__"; +static char __pyx_k_XDict___ne[] = "XDict.__ne__"; +static char __pyx_k_XFSet_type[] = "XFSet.type"; +static char __pyx_k_XFSet_xset[] = "XFSet.xset"; +static char __pyx_k_XList___eq[] = "XList.__eq__"; +static char __pyx_k_XList___ne[] = "XList.__ne__"; +static char __pyx_k_XList_join[] = "XList.join"; +static char __pyx_k_XList_xset[] = "XList.xset"; +static char __pyx_k_XSet_xfset[] = "XSet.xfset"; +static char __pyx_k_XSet_xlist[] = "XSet.xlist"; +static char __pyx_k_XUnicode_2[] = "XUnicode_2"; +static char __pyx_k_XUnicode_3[] = "XUnicode_3"; +static char __pyx_k_attributes[] = "attributes"; +static char __pyx_k_difference[] = "difference"; +static char __pyx_k_end_string[] = "end_string"; +static char __pyx_k_equal_type[] = "_equal_type"; +static char __pyx_k_first_list[] = "first_list"; +static char __pyx_k_max_length[] = "max_length"; +static char __pyx_k_naked_type[] = "naked_type"; +static char __pyx_k_other_dict[] = "other_dict"; +static char __pyx_k_test_value[] = "test_value"; +static char __pyx_k_the_object[] = "the_object"; +static char __pyx_k_value_name[] = "value_name"; +static char __pyx_k_xsplit_set[] = "xsplit_set"; +static char __pyx_k_NakedObject[] = "NakedObject"; +static char __pyx_k_XDict___add[] = "XDict.__add__"; +static char __pyx_k_XFSet___new[] = "XFSet.__new__"; +static char __pyx_k_XFSet_xlist[] = "XFSet.xlist"; +static char __pyx_k_XList___add[] = "XList.__add__"; +static char __pyx_k_XList_xfset[] = "XList.xfset"; +static char __pyx_k_XSet___iadd[] = "XSet.__iadd__"; +static char __pyx_k_XSet___init[] = "XSet.__init__"; +static char __pyx_k_XTuple_type[] = "XTuple.type"; +static char __pyx_k_another_set[] = "another_set"; +static char __pyx_k_collections[] = "collections"; +static char __pyx_k_fnmatchcase[] = "fnmatchcase"; +static char __pyx_k_map_to_vals[] = "map_to_vals"; +static char __pyx_k_other_lists[] = "other_lists"; +static char __pyx_k_result_list[] = "result_list"; +static char __pyx_k_return_list[] = "return_list"; +static char __pyx_k_string_text[] = "string_text"; +static char __pyx_k_test_string[] = "test_string"; +static char __pyx_k_unicodedata[] = "unicodedata"; +static char __pyx_k_XDict___iadd[] = "XDict.__iadd__"; +static char __pyx_k_XDict___init[] = "XDict.__init__"; +static char __pyx_k_XDict_equals[] = "XDict.equals"; +static char __pyx_k_XDict_random[] = "XDict.random"; +static char __pyx_k_XDict_xitems[] = "XDict.xitems"; +static char __pyx_k_XList___iadd[] = "XList.__iadd__"; +static char __pyx_k_XList___init[] = "XList.__init__"; +static char __pyx_k_XList_equals[] = "XList.equals"; +static char __pyx_k_XList_prefix[] = "XList.prefix"; +static char __pyx_k_XList_random[] = "XList.random"; +static char __pyx_k_XList_xtuple[] = "XList.xtuple"; +static char __pyx_k_XMaxHeap_pop[] = "XMaxHeap.pop"; +static char __pyx_k_XMinHeap_pop[] = "XMinHeap.pop"; +static char __pyx_k_XString_ends[] = "XString.ends"; +static char __pyx_k_XString_type[] = "XString.type"; +static char __pyx_k_XTuple___new[] = "XTuple.__new__"; +static char __pyx_k_another_dict[] = "another_dict"; +static char __pyx_k_another_list[] = "another_list"; +static char __pyx_k_begin_string[] = "begin_string"; +static char __pyx_k_intersection[] = "intersection"; +static char __pyx_k_map_to_items[] = "map_to_items"; +static char __pyx_k_naked_type_2[] = "_naked_type_"; +static char __pyx_k_norm_unicode[] = "norm_unicode"; +static char __pyx_k_other_string[] = "other_string"; +static char __pyx_k_val_count_ci[] = "val_count_ci"; +static char __pyx_k_version_info[] = "version_info"; +static char __pyx_k_XDict_max_val[] = "XDict.max_val"; +static char __pyx_k_XDict_min_val[] = "XDict.min_val"; +static char __pyx_k_XList_postfix[] = "XList.postfix"; +static char __pyx_k_XList_shuffle[] = "XList.shuffle"; +static char __pyx_k_XMaxHeap_push[] = "XMaxHeap.push"; +static char __pyx_k_XMinHeap_push[] = "XMinHeap.push"; +static char __pyx_k_XQueue___init[] = "XQueue.__init__"; +static char __pyx_k_XSet___lshift[] = "XSet.__lshift__"; +static char __pyx_k_XString___new[] = "XString.__new__"; +static char __pyx_k_XUnicode_type[] = "XUnicode.type"; +static char __pyx_k_random_sample[] = "random_sample"; +static char __pyx_k_the_attribute[] = "the_attribute"; +static char __pyx_k_AttributeError[] = "AttributeError"; +static char __pyx_k_Naked_settings[] = "Naked.settings"; +static char __pyx_k_XDict_sum_vals[] = "XDict.sum_vals"; +static char __pyx_k_XList_count_ci[] = "XList.count_ci"; +static char __pyx_k_XList_surround[] = "XList.surround"; +static char __pyx_k_XMaxHeap___len[] = "XMaxHeap.__len__"; +static char __pyx_k_XMinHeap___len[] = "XMinHeap.__len__"; +static char __pyx_k_XString_begins[] = "XString.begins"; +static char __pyx_k_XString_concat[] = "XString.concat"; +static char __pyx_k_XString_xsplit[] = "XString.xsplit"; +static char __pyx_k_XUnicode___cmp[] = "XUnicode.__cmp__"; +static char __pyx_k_XUnicode___str[] = "XUnicode.__str__"; +static char __pyx_k_naked_u_string[] = "naked_u_string"; +static char __pyx_k_wildcard_match[] = "wildcard_match"; +static char __pyx_k_XDict_key_xlist[] = "XDict.key_xlist"; +static char __pyx_k_XDict_val_count[] = "XDict.val_count"; +static char __pyx_k_XDict_val_xlist[] = "XDict.val_xlist"; +static char __pyx_k_XMaxHeap___init[] = "XMaxHeap.__init__"; +static char __pyx_k_XMaxHeap_length[] = "XMaxHeap.length"; +static char __pyx_k_XMinHeap___init[] = "XMinHeap.__init__"; +static char __pyx_k_XMinHeap_length[] = "XMinHeap.length"; +static char __pyx_k_XString_unicode[] = "XString.unicode"; +static char __pyx_k_XUnicode___init[] = "XUnicode.__init__"; +static char __pyx_k_XUnicode___repr[] = "XUnicode.__repr__"; +static char __pyx_k_mapped_function[] = "mapped_function"; +static char __pyx_k_nkd_fnmatchcase[] = "nkd_fnmatchcase"; +static char __pyx_k_number_of_items[] = "number_of_items"; +static char __pyx_k_random_key_list[] = "random_key_list"; +static char __pyx_k_split_delimiter[] = "split_delimiter"; +static char __pyx_k_the_string_text[] = "the_string_text"; +static char __pyx_k_NakedObject___eq[] = "NakedObject.__eq__"; +static char __pyx_k_NakedObject___ne[] = "NakedObject.__ne__"; +static char __pyx_k_NakedObject_type[] = "NakedObject.type"; +static char __pyx_k_XDict_difference[] = "XDict.difference"; +static char __pyx_k_XList_difference[] = "XList.difference"; +static char __pyx_k_XMaxHeap_pushpop[] = "XMaxHeap.pushpop"; +static char __pyx_k_XMinHeap_pushpop[] = "XMinHeap.pushpop"; +static char __pyx_k_XString_contains[] = "XString.contains"; +static char __pyx_k_count_duplicates[] = "count_duplicates"; +static char __pyx_k_equal_attributes[] = "_equal_attributes"; +static char __pyx_k_getAttributeDict[] = "_getAttributeDict"; +static char __pyx_k_initial_iterable[] = "initial_iterable"; +static char __pyx_k_py_major_version[] = "py_major_version"; +static char __pyx_k_XDict_map_to_vals[] = "XDict.map_to_vals"; +static char __pyx_k_remove_duplicates[] = "remove_duplicates"; +static char __pyx_k_NakedObject___init[] = "NakedObject.__init__"; +static char __pyx_k_NakedObject_equals[] = "NakedObject.equals"; +static char __pyx_k_XDict_intersection[] = "XDict.intersection"; +static char __pyx_k_XDict_val_count_ci[] = "XDict.val_count_ci"; +static char __pyx_k_XList_intersection[] = "XList.intersection"; +static char __pyx_k_XList_map_to_items[] = "XList.map_to_items"; +static char __pyx_k_XString_xsplit_set[] = "XString.xsplit_set"; +static char __pyx_k_XUnicode___getattr[] = "XUnicode.__getattr__"; +static char __pyx_k_XDict_random_sample[] = "XDict.random_sample"; +static char __pyx_k_XList_random_sample[] = "XList.random_sample"; +static char __pyx_k_XList_wildcard_match[] = "XList.wildcard_match"; +static char __pyx_k_conditional_function[] = "conditional_function"; +static char __pyx_k_multi_wildcard_match[] = "multi_wildcard_match"; +static char __pyx_k_Naked_toolshed_python[] = "Naked.toolshed.python"; +static char __pyx_k_XList_count_duplicates[] = "XList.count_duplicates"; +static char __pyx_k_XString_wildcard_match[] = "XString.wildcard_match"; +static char __pyx_k_NakedObject__equal_type[] = "NakedObject._equal_type"; +static char __pyx_k_XFSet__getAttributeDict[] = "XFSet._getAttributeDict"; +static char __pyx_k_XList_remove_duplicates[] = "XList.remove_duplicates"; +static char __pyx_k_conditional_map_to_vals[] = "conditional_map_to_vals"; +static char __pyx_k_XTuple__getAttributeDict[] = "XTuple._getAttributeDict"; +static char __pyx_k_conditional_map_to_items[] = "conditional_map_to_items"; +static char __pyx_k_XString__getAttributeDict[] = "XString._getAttributeDict"; +static char __pyx_k_XList_multi_wildcard_match[] = "XList.multi_wildcard_match"; +static char __pyx_k_XUnicode__getAttributeDict[] = "XUnicode._getAttributeDict"; +static char __pyx_k_lib_Naked_toolshed_c_types[] = "lib.Naked.toolshed.c.types"; +static char __pyx_k_NakedObject__equal_attributes[] = "NakedObject._equal_attributes"; +static char __pyx_k_NakedObject__getAttributeDict[] = "NakedObject._getAttributeDict"; +static char __pyx_k_XDict_conditional_map_to_vals[] = "XDict.conditional_map_to_vals"; +static char __pyx_k_XList_conditional_map_to_items[] = "XList.conditional_map_to_items"; +static char __pyx_k_Naked_Framework_Error_unable_to[] = "Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)"; +static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/types.pyx"; +static char __pyx_k_XUnicode___init___locals_XUnicod[] = "XUnicode.__init__..XUnicode_2"; +static char __pyx_k_Naked_Framework_Error_unable_to_2[] = "Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)"; +static char __pyx_k_XUnicode___init___locals_XUnicod_2[] = "XUnicode.__init__..XUnicode_2.__new__"; +static char __pyx_k_XUnicode___init___locals_XUnicod_3[] = "XUnicode.__init__..XUnicode_3"; +static char __pyx_k_XUnicode___init___locals_XUnicod_4[] = "XUnicode.__init__..XUnicode_3.__new__"; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_DEBUG_FLAG; +static PyObject *__pyx_n_s_Exception; +static PyObject *__pyx_n_s_NFKD; +static PyObject *__pyx_n_s_NakedObject; +static PyObject *__pyx_n_s_NakedObject___eq; +static PyObject *__pyx_n_s_NakedObject___init; +static PyObject *__pyx_n_s_NakedObject___ne; +static PyObject *__pyx_n_s_NakedObject__equal_attributes; +static PyObject *__pyx_n_s_NakedObject__equal_type; +static PyObject *__pyx_n_s_NakedObject__getAttributeDict; +static PyObject *__pyx_n_s_NakedObject_equals; +static PyObject *__pyx_n_s_NakedObject_type; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to; +static PyObject *__pyx_kp_s_Naked_Framework_Error_unable_to_2; +static PyObject *__pyx_n_s_Naked_settings; +static PyObject *__pyx_n_s_Naked_toolshed_python; +static PyObject *__pyx_kp_s_UTF_8; +static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li; +static PyObject *__pyx_n_s_XDict; +static PyObject *__pyx_n_s_XDict___add; +static PyObject *__pyx_n_s_XDict___eq; +static PyObject *__pyx_n_s_XDict___iadd; +static PyObject *__pyx_n_s_XDict___init; +static PyObject *__pyx_n_s_XDict___ne; +static PyObject *__pyx_n_s_XDict_conditional_map_to_vals; +static PyObject *__pyx_n_s_XDict_difference; +static PyObject *__pyx_n_s_XDict_equals; +static PyObject *__pyx_n_s_XDict_intersection; +static PyObject *__pyx_n_s_XDict_key_xlist; +static PyObject *__pyx_n_s_XDict_map_to_vals; +static PyObject *__pyx_n_s_XDict_max_val; +static PyObject *__pyx_n_s_XDict_min_val; +static PyObject *__pyx_n_s_XDict_random; +static PyObject *__pyx_n_s_XDict_random_sample; +static PyObject *__pyx_n_s_XDict_sum_vals; +static PyObject *__pyx_n_s_XDict_val_count; +static PyObject *__pyx_n_s_XDict_val_count_ci; +static PyObject *__pyx_n_s_XDict_val_xlist; +static PyObject *__pyx_n_s_XDict_xitems; +static PyObject *__pyx_n_s_XFSet; +static PyObject *__pyx_n_s_XFSet___new; +static PyObject *__pyx_n_s_XFSet__getAttributeDict; +static PyObject *__pyx_n_s_XFSet_type; +static PyObject *__pyx_n_s_XFSet_xlist; +static PyObject *__pyx_n_s_XFSet_xset; +static PyObject *__pyx_n_s_XList; +static PyObject *__pyx_n_s_XList___add; +static PyObject *__pyx_n_s_XList___eq; +static PyObject *__pyx_n_s_XList___iadd; +static PyObject *__pyx_n_s_XList___init; +static PyObject *__pyx_n_s_XList___ne; +static PyObject *__pyx_n_s_XList_conditional_map_to_items; +static PyObject *__pyx_n_s_XList_count_ci; +static PyObject *__pyx_n_s_XList_count_duplicates; +static PyObject *__pyx_n_s_XList_difference; +static PyObject *__pyx_n_s_XList_equals; +static PyObject *__pyx_n_s_XList_intersection; +static PyObject *__pyx_n_s_XList_join; +static PyObject *__pyx_n_s_XList_map_to_items; +static PyObject *__pyx_n_s_XList_max; +static PyObject *__pyx_n_s_XList_min; +static PyObject *__pyx_n_s_XList_multi_wildcard_match; +static PyObject *__pyx_n_s_XList_postfix; +static PyObject *__pyx_n_s_XList_prefix; +static PyObject *__pyx_n_s_XList_random; +static PyObject *__pyx_n_s_XList_random_sample; +static PyObject *__pyx_n_s_XList_remove_duplicates; +static PyObject *__pyx_n_s_XList_shuffle; +static PyObject *__pyx_n_s_XList_sum; +static PyObject *__pyx_n_s_XList_surround; +static PyObject *__pyx_n_s_XList_wildcard_match; +static PyObject *__pyx_n_s_XList_xfset; +static PyObject *__pyx_n_s_XList_xset; +static PyObject *__pyx_n_s_XList_xtuple; +static PyObject *__pyx_n_s_XMaxHeap; +static PyObject *__pyx_n_s_XMaxHeap___init; +static PyObject *__pyx_n_s_XMaxHeap___len; +static PyObject *__pyx_n_s_XMaxHeap_length; +static PyObject *__pyx_n_s_XMaxHeap_pop; +static PyObject *__pyx_n_s_XMaxHeap_push; +static PyObject *__pyx_n_s_XMaxHeap_pushpop; +static PyObject *__pyx_n_s_XMinHeap; +static PyObject *__pyx_n_s_XMinHeap___init; +static PyObject *__pyx_n_s_XMinHeap___len; +static PyObject *__pyx_n_s_XMinHeap_length; +static PyObject *__pyx_n_s_XMinHeap_pop; +static PyObject *__pyx_n_s_XMinHeap_push; +static PyObject *__pyx_n_s_XMinHeap_pushpop; +static PyObject *__pyx_n_s_XQueue; +static PyObject *__pyx_n_s_XQueue___init; +static PyObject *__pyx_n_s_XSet; +static PyObject *__pyx_n_s_XSet___iadd; +static PyObject *__pyx_n_s_XSet___init; +static PyObject *__pyx_n_s_XSet___lshift; +static PyObject *__pyx_n_s_XSet_xfset; +static PyObject *__pyx_n_s_XSet_xlist; +static PyObject *__pyx_n_s_XString; +static PyObject *__pyx_n_s_XString___new; +static PyObject *__pyx_n_s_XString__getAttributeDict; +static PyObject *__pyx_n_s_XString_begins; +static PyObject *__pyx_n_s_XString_concat; +static PyObject *__pyx_n_s_XString_contains; +static PyObject *__pyx_n_s_XString_ends; +static PyObject *__pyx_n_s_XString_type; +static PyObject *__pyx_n_s_XString_unicode; +static PyObject *__pyx_n_s_XString_wildcard_match; +static PyObject *__pyx_n_s_XString_xsplit; +static PyObject *__pyx_n_s_XString_xsplit_set; +static PyObject *__pyx_n_s_XTuple; +static PyObject *__pyx_n_s_XTuple___new; +static PyObject *__pyx_n_s_XTuple__getAttributeDict; +static PyObject *__pyx_n_s_XTuple_type; +static PyObject *__pyx_n_s_XUnicode; +static PyObject *__pyx_n_s_XUnicode2; +static PyObject *__pyx_n_s_XUnicode3; +static PyObject *__pyx_n_s_XUnicode_2; +static PyObject *__pyx_n_s_XUnicode_3; +static PyObject *__pyx_n_s_XUnicode___cmp; +static PyObject *__pyx_n_s_XUnicode___getattr; +static PyObject *__pyx_n_s_XUnicode___init; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod_2; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod_3; +static PyObject *__pyx_n_s_XUnicode___init___locals_XUnicod_4; +static PyObject *__pyx_n_s_XUnicode___repr; +static PyObject *__pyx_n_s_XUnicode___str; +static PyObject *__pyx_n_s_XUnicode__getAttributeDict; +static PyObject *__pyx_n_s_XUnicode_type; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_kp_s__9; +static PyObject *__pyx_n_s_add; +static PyObject *__pyx_n_s_after; +static PyObject *__pyx_n_s_another_dict; +static PyObject *__pyx_n_s_another_list; +static PyObject *__pyx_n_s_another_set; +static PyObject *__pyx_n_s_attr_dict; +static PyObject *__pyx_n_s_attributes; +static PyObject *__pyx_n_s_before; +static PyObject *__pyx_n_s_begin_string; +static PyObject *__pyx_n_s_begins; +static PyObject *__pyx_n_s_choice; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_cmp; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_concat; +static PyObject *__pyx_n_s_conditional_function; +static PyObject *__pyx_n_s_conditional_map_to_items; +static PyObject *__pyx_n_s_conditional_map_to_vals; +static PyObject *__pyx_n_s_contains; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_count_ci; +static PyObject *__pyx_n_s_count_duplicates; +static PyObject *__pyx_n_s_debug; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_delim2; +static PyObject *__pyx_n_s_deque; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dict_obj; +static PyObject *__pyx_n_s_difference; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_end_string; +static PyObject *__pyx_n_s_ends; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_eq; +static PyObject *__pyx_n_s_equal_attributes; +static PyObject *__pyx_n_s_equal_type; +static PyObject *__pyx_n_s_equals; +static PyObject *__pyx_n_s_extend; +static PyObject *__pyx_n_s_first_list; +static PyObject *__pyx_n_s_fnmatch; +static PyObject *__pyx_n_s_fnmatchcase; +static PyObject *__pyx_n_s_getAttributeDict; +static PyObject *__pyx_n_s_getattr; +static PyObject *__pyx_n_s_heappop; +static PyObject *__pyx_n_s_heappush; +static PyObject *__pyx_n_s_heapq; +static PyObject *__pyx_n_s_iadd; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_index; +static PyObject *__pyx_n_s_index_2; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_initial_iterable; +static PyObject *__pyx_n_s_intersection; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_iteritems; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_key_xlist; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_len; +static PyObject *__pyx_n_s_length; +static PyObject *__pyx_n_s_lib_Naked_toolshed_c_types; +static PyObject *__pyx_n_s_list_obj; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_lshift; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_map_to_items; +static PyObject *__pyx_n_s_map_to_vals; +static PyObject *__pyx_n_s_mapped_function; +static PyObject *__pyx_n_s_max; +static PyObject *__pyx_n_s_max_length; +static PyObject *__pyx_n_s_max_val; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_min; +static PyObject *__pyx_n_s_min_val; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_multi_wildcard_match; +static PyObject *__pyx_n_s_naked_type; +static PyObject *__pyx_n_s_naked_type_2; +static PyObject *__pyx_n_s_naked_u_string; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_ne; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_new_dict; +static PyObject *__pyx_n_s_nkd_fnmatchcase; +static PyObject *__pyx_n_s_norm_text; +static PyObject *__pyx_n_s_norm_unicode; +static PyObject *__pyx_n_s_normalize; +static PyObject *__pyx_n_s_number_of_items; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_other_dict; +static PyObject *__pyx_n_s_other_lists; +static PyObject *__pyx_n_s_other_obj; +static PyObject *__pyx_n_s_other_string; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_postfix; +static PyObject *__pyx_n_s_prefix; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_push; +static PyObject *__pyx_n_s_pushpop; +static PyObject *__pyx_n_s_py_major_version; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_queue; +static PyObject *__pyx_n_s_random; +static PyObject *__pyx_n_s_random_key_list; +static PyObject *__pyx_n_s_random_sample; +static PyObject *__pyx_n_s_re; +static PyObject *__pyx_n_s_remove_duplicates; +static PyObject *__pyx_n_s_repr; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_result_list; +static PyObject *__pyx_n_s_return_list; +static PyObject *__pyx_n_s_sample; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_separator; +static PyObject *__pyx_n_s_set_obj; +static PyObject *__pyx_n_s_shuffle; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_n_s_split_delimiter; +static PyObject *__pyx_n_s_stderr; +static PyObject *__pyx_n_s_str; +static PyObject *__pyx_n_s_str_list; +static PyObject *__pyx_n_s_str_obj; +static PyObject *__pyx_n_s_string_text; +static PyObject *__pyx_n_s_strings; +static PyObject *__pyx_n_s_subitem; +static PyObject *__pyx_n_s_substring; +static PyObject *__pyx_n_s_sum; +static PyObject *__pyx_n_s_sum_vals; +static PyObject *__pyx_n_s_surround; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_temp_list; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_test_string; +static PyObject *__pyx_n_s_test_value; +static PyObject *__pyx_n_s_the_attribute; +static PyObject *__pyx_n_s_the_key; +static PyObject *__pyx_n_s_the_list; +static PyObject *__pyx_n_s_the_object; +static PyObject *__pyx_n_s_the_set; +static PyObject *__pyx_n_s_the_string_text; +static PyObject *__pyx_n_s_the_tuple; +static PyObject *__pyx_n_s_tup_obj; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_n_s_unicodedata; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_kp_s_utf_8; +static PyObject *__pyx_n_s_val_count; +static PyObject *__pyx_n_s_val_count_ci; +static PyObject *__pyx_n_s_val_xlist; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_value_name; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_wc; +static PyObject *__pyx_n_s_wc_list; +static PyObject *__pyx_n_s_wildcard; +static PyObject *__pyx_n_s_wildcard_match; +static PyObject *__pyx_n_s_wildcards; +static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_n_s_xfset; +static PyObject *__pyx_n_s_xitems; +static PyObject *__pyx_n_s_xlist; +static PyObject *__pyx_n_s_xset; +static PyObject *__pyx_n_s_xsplit; +static PyObject *__pyx_n_s_xsplit_set; +static PyObject *__pyx_n_s_xtuple; +static PyObject *__pyx_n_s_zip; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_10; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_tuple__90; +static PyObject *__pyx_tuple__92; +static PyObject *__pyx_tuple__94; +static PyObject *__pyx_tuple__95; +static PyObject *__pyx_tuple__97; +static PyObject *__pyx_tuple__99; +static PyObject *__pyx_tuple__101; +static PyObject *__pyx_tuple__103; +static PyObject *__pyx_tuple__105; +static PyObject *__pyx_tuple__107; +static PyObject *__pyx_tuple__109; +static PyObject *__pyx_tuple__111; +static PyObject *__pyx_tuple__113; +static PyObject *__pyx_tuple__115; +static PyObject *__pyx_tuple__117; +static PyObject *__pyx_tuple__119; +static PyObject *__pyx_tuple__121; +static PyObject *__pyx_tuple__123; +static PyObject *__pyx_tuple__125; +static PyObject *__pyx_tuple__127; +static PyObject *__pyx_tuple__129; +static PyObject *__pyx_tuple__131; +static PyObject *__pyx_tuple__133; +static PyObject *__pyx_tuple__135; +static PyObject *__pyx_tuple__137; +static PyObject *__pyx_tuple__139; +static PyObject *__pyx_tuple__141; +static PyObject *__pyx_tuple__143; +static PyObject *__pyx_tuple__145; +static PyObject *__pyx_tuple__147; +static PyObject *__pyx_tuple__149; +static PyObject *__pyx_tuple__151; +static PyObject *__pyx_tuple__153; +static PyObject *__pyx_tuple__155; +static PyObject *__pyx_tuple__157; +static PyObject *__pyx_tuple__159; +static PyObject *__pyx_tuple__161; +static PyObject *__pyx_tuple__163; +static PyObject *__pyx_tuple__165; +static PyObject *__pyx_tuple__167; +static PyObject *__pyx_tuple__169; +static PyObject *__pyx_tuple__171; +static PyObject *__pyx_tuple__173; +static PyObject *__pyx_tuple__175; +static PyObject *__pyx_tuple__177; +static PyObject *__pyx_tuple__179; +static PyObject *__pyx_tuple__181; +static PyObject *__pyx_tuple__183; +static PyObject *__pyx_tuple__185; +static PyObject *__pyx_tuple__187; +static PyObject *__pyx_tuple__189; +static PyObject *__pyx_tuple__191; +static PyObject *__pyx_tuple__193; +static PyObject *__pyx_tuple__195; +static PyObject *__pyx_tuple__197; +static PyObject *__pyx_tuple__199; +static PyObject *__pyx_tuple__201; +static PyObject *__pyx_tuple__203; +static PyObject *__pyx_tuple__205; +static PyObject *__pyx_tuple__207; +static PyObject *__pyx_tuple__209; +static PyObject *__pyx_tuple__211; +static PyObject *__pyx_tuple__213; +static PyObject *__pyx_tuple__215; +static PyObject *__pyx_tuple__217; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__89; +static PyObject *__pyx_codeobj__91; +static PyObject *__pyx_codeobj__93; +static PyObject *__pyx_codeobj__96; +static PyObject *__pyx_codeobj__98; +static PyObject *__pyx_codeobj__100; +static PyObject *__pyx_codeobj__102; +static PyObject *__pyx_codeobj__104; +static PyObject *__pyx_codeobj__106; +static PyObject *__pyx_codeobj__108; +static PyObject *__pyx_codeobj__110; +static PyObject *__pyx_codeobj__112; +static PyObject *__pyx_codeobj__114; +static PyObject *__pyx_codeobj__116; +static PyObject *__pyx_codeobj__118; +static PyObject *__pyx_codeobj__120; +static PyObject *__pyx_codeobj__122; +static PyObject *__pyx_codeobj__124; +static PyObject *__pyx_codeobj__126; +static PyObject *__pyx_codeobj__128; +static PyObject *__pyx_codeobj__130; +static PyObject *__pyx_codeobj__132; +static PyObject *__pyx_codeobj__134; +static PyObject *__pyx_codeobj__136; +static PyObject *__pyx_codeobj__138; +static PyObject *__pyx_codeobj__140; +static PyObject *__pyx_codeobj__142; +static PyObject *__pyx_codeobj__144; +static PyObject *__pyx_codeobj__146; +static PyObject *__pyx_codeobj__148; +static PyObject *__pyx_codeobj__150; +static PyObject *__pyx_codeobj__152; +static PyObject *__pyx_codeobj__154; +static PyObject *__pyx_codeobj__156; +static PyObject *__pyx_codeobj__158; +static PyObject *__pyx_codeobj__160; +static PyObject *__pyx_codeobj__162; +static PyObject *__pyx_codeobj__164; +static PyObject *__pyx_codeobj__166; +static PyObject *__pyx_codeobj__168; +static PyObject *__pyx_codeobj__170; +static PyObject *__pyx_codeobj__172; +static PyObject *__pyx_codeobj__174; +static PyObject *__pyx_codeobj__176; +static PyObject *__pyx_codeobj__178; +static PyObject *__pyx_codeobj__180; +static PyObject *__pyx_codeobj__182; +static PyObject *__pyx_codeobj__184; +static PyObject *__pyx_codeobj__186; +static PyObject *__pyx_codeobj__188; +static PyObject *__pyx_codeobj__190; +static PyObject *__pyx_codeobj__192; +static PyObject *__pyx_codeobj__194; +static PyObject *__pyx_codeobj__196; +static PyObject *__pyx_codeobj__198; +static PyObject *__pyx_codeobj__200; +static PyObject *__pyx_codeobj__202; +static PyObject *__pyx_codeobj__204; +static PyObject *__pyx_codeobj__206; +static PyObject *__pyx_codeobj__208; +static PyObject *__pyx_codeobj__210; +static PyObject *__pyx_codeobj__212; +static PyObject *__pyx_codeobj__214; +static PyObject *__pyx_codeobj__216; +static PyObject *__pyx_codeobj__218; + +/* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_NakedObject)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_NakedObject)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_NakedObject)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[3] = {0,0,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_attributes; + values[2] = ((PyObject *)((PyObject*)__pyx_n_s_NakedObject)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_attributes = values[1]; + __pyx_v_naked_type = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject___init__(__pyx_self, __pyx_v_self, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":18 + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(self, key, attributes[key]) + */ + __pyx_t_1 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 > 0) != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":19 + * def __init__(self, attributes={}, naked_type='NakedObject'): + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(self, key, attributes[key]) + * setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_3); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":20 + * if len(attributes) > 0: + * for key in attributes: + * setattr(self, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + * + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":21 + * for key in attributes: + * setattr(self, key, attributes[key]) + * setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_6 = PyObject_SetAttr(__pyx_v_self, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":28 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type = {__Pyx_NAMESTR("_equal_type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_equal_type (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_equal_type", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_equal_type") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_equal_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_4_equal_type(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_4_equal_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_equal_type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":35 + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): + * return type(self) == type(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_self)), ((PyObject *)Py_TYPE(__pyx_v_other_obj)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes = {__Pyx_NAMESTR("_equal_attributes"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_equal_attributes (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_equal_attributes", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_equal_attributes") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_equal_attributes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_6_equal_attributes(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_6_equal_attributes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_equal_attributes", 0); + + /* "lib/Naked/toolshed/c/types.pyx":42 + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): + * return self.__dict__ == other_obj.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject._equal_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_8__eq__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_8__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":48 + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): + * return self.equals(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_10__ne__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_10__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":54 + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): + * result = self.equals(other_obj) # <<<<<<<<<<<<<< + * if result: + * return False # reverse result of the equals method + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":55 + * def __ne__(self, other_obj): + * result = self.equals(other_obj) + * if result: # <<<<<<<<<<<<<< + * return False # reverse result of the equals method + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/types.pyx":56 + * result = self.equals(other_obj) + * if result: + * return False # reverse result of the equals method # <<<<<<<<<<<<<< + * else: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":58 + * return False # reverse result of the equals method + * else: + * return True # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals = {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_12equals(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_12equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":66 + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_attributes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + } else { + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_14type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_14type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":73 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":74 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":76 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.NakedObject.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XDict)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XDict)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XDict)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_dict_obj = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dict_obj,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XDict)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dict_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_dict_obj = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict___init__(__pyx_self, __pyx_v_self, __pyx_v_dict_obj, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dict_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":84 + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_dict_obj); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_dict_obj); + __Pyx_GIVEREF(__pyx_v_dict_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":85 + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__ = {__Pyx_NAMESTR("__add__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_2__add__(__pyx_self, __pyx_v_self, __pyx_v_other_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":97 + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): + * try: # <<<<<<<<<<<<<< + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":98 + * def __add__(self, other_dict): + * try: + * self.update(other_dict) # <<<<<<<<<<<<<< + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_other_dict); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_other_dict); + __Pyx_GIVEREF(__pyx_v_other_dict); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":99 + * try: + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): # <<<<<<<<<<<<<< + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + */ + __pyx_t_7 = PyObject_HasAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_XDict, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":100 + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_dict, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_attr_dict = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":101 + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_10 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = ((__pyx_t_10 > 0) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":102 + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * return self + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_5 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_11(__pyx_t_5); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":103 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_6 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/types.pyx":104 + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":105 + * setattr(self, key, attr_dict[key]) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/types.pyx":106 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":107 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/types.pyx":108 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__ = {__Pyx_NAMESTR("__iadd__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__iadd__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_4__iadd__(__pyx_self, __pyx_v_self, __pyx_v_other_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_dict) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + int __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iadd__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":116 + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): + * try: # <<<<<<<<<<<<<< + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":117 + * def __iadd__(self, other_dict): + * try: + * self.update(other_dict) # <<<<<<<<<<<<<< + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_other_dict); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_other_dict); + __Pyx_GIVEREF(__pyx_v_other_dict); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":118 + * try: + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): # <<<<<<<<<<<<<< + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + */ + __pyx_t_7 = PyObject_HasAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_other_dict, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_XDict, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":119 + * self.update(other_dict) + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_dict, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_attr_dict = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":120 + * if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_10 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = ((__pyx_t_10 > 0) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":121 + * attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * return self + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_5 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + for (;;) { + if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_11(__pyx_t_5); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":122 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_6 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/types.pyx":123 + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":124 + * setattr(self, key, attr_dict[key]) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __pyx_v_e = __pyx_t_6; + + /* "lib/Naked/toolshed/c/types.pyx":125 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":126 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/types.pyx":127 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":133 + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): + * return self.equals(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_8__ne__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":139 + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): + * result = self.equals(other_obj) # <<<<<<<<<<<<<< + * if result: + * return False # reverse result of the equals method + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":140 + * def __ne__(self, other_obj): + * result = self.equals(other_obj) + * if result: # <<<<<<<<<<<<<< + * return False # reverse result of the equals method + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/types.pyx":141 + * result = self.equals(other_obj) + * if result: + * return False # reverse result of the equals method # <<<<<<<<<<<<<< + * else: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":143 + * return False # reverse result of the equals method + * else: + * return True # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals = {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_10equals(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":150 + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): # <<<<<<<<<<<<<< + * if dict(self) == dict(other_obj): + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":151 + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":152 + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":154 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":156 + * return False + * else: + * return False # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals = {__Pyx_NAMESTR("conditional_map_to_vals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_conditional_function = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("conditional_map_to_vals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_conditional_function,&__pyx_n_s_mapped_function,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_vals", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_vals", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conditional_map_to_vals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_conditional_function = values[1]; + __pyx_v_mapped_function = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("conditional_map_to_vals", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.conditional_map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_12conditional_map_to_vals(__pyx_self, __pyx_v_self, __pyx_v_conditional_function, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_12conditional_map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("conditional_map_to_vals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":168 + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): + * for key, value in self.xitems(): # <<<<<<<<<<<<<< + * if conditional_function(key): + * self[key] = mapped_function(value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xitems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":169 + * def conditional_map_to_vals(self, conditional_function, mapped_function): + * for key, value in self.xitems(): + * if conditional_function(key): # <<<<<<<<<<<<<< + * self[key] = mapped_function(value) + * return self + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_conditional_function, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":170 + * for key, value in self.xitems(): + * if conditional_function(key): + * self[key] = mapped_function(value) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_key, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L7; + } + __pyx_L7:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":171 + * if conditional_function(key): + * self[key] = mapped_function(value) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.conditional_map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals = {__Pyx_NAMESTR("map_to_vals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_to_vals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mapped_function,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_to_vals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_to_vals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_mapped_function = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_to_vals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_14map_to_vals(__pyx_self, __pyx_v_self, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_14map_to_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_to_vals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":180 + * def map_to_vals(self, mapped_function): + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): # <<<<<<<<<<<<<< + * self[key] = mapped_function(value) + * return self + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xitems); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + #if CYTHON_COMPILING_IN_CPYTHON + Py_ssize_t size = Py_SIZE(sequence); + #else + Py_ssize_t size = PySequence_Size(sequence); + #endif + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + #if CYTHON_COMPILING_IN_CPYTHON + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":181 + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + * self[key] = mapped_function(value) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_key, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":182 + * for key, value in self.xitems(): + * self[key] = mapped_function(value) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.map_to_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist = {__Pyx_NAMESTR("val_xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("val_xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_16val_xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_16val_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("val_xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":190 + * #------------------------------------------------------------------------------ + * def val_xlist(self): + * return XList(self.values(), self._getAttributeDict()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val = {__Pyx_NAMESTR("max_val"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max_val (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_18max_val(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_18max_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max_val", 0); + + /* "lib/Naked/toolshed/c/types.pyx":197 + * #------------------------------------------------------------------------------ + * def max_val(self): + * return max(zip(self.values(), self.keys())) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.max_val", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val = {__Pyx_NAMESTR("min_val"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("min_val (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_20min_val(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_20min_val(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("min_val", 0); + + /* "lib/Naked/toolshed/c/types.pyx":203 + * #------------------------------------------------------------------------------ + * def min_val(self): + * return min(zip(self.values(), self.keys())) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.min_val", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals = {__Pyx_NAMESTR("sum_vals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sum_vals (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_22sum_vals(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_22sum_vals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sum_vals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":210 + * #------------------------------------------------------------------------------ + * def sum_vals(self): + * return sum(self.values()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.sum_vals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count = {__Pyx_NAMESTR("val_count"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("val_count (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("val_count", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "val_count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_value_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("val_count", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_24val_count(__pyx_self, __pyx_v_self, __pyx_v_value_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_24val_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name) { + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_test_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("val_count", 0); + + /* "lib/Naked/toolshed/c/types.pyx":219 + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): + * count = 0 # <<<<<<<<<<<<<< + * for test_value in self.values(): + * if value_name == test_value: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_count = __pyx_int_0; + + /* "lib/Naked/toolshed/c/types.pyx":220 + * def val_count(self, value_name): + * count = 0 + * for test_value in self.values(): # <<<<<<<<<<<<<< + * if value_name == test_value: + * count += 1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_test_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":221 + * count = 0 + * for test_value in self.values(): + * if value_name == test_value: # <<<<<<<<<<<<<< + * count += 1 + * return count + */ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_value_name, __pyx_v_test_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":222 + * for test_value in self.values(): + * if value_name == test_value: + * count += 1 # <<<<<<<<<<<<<< + * return count + * + */ + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":223 + * if value_name == test_value: + * count += 1 + * return count # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_count); + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_test_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci = {__Pyx_NAMESTR("val_count_ci"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value_name = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("val_count_ci (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value_name,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_name)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("val_count_ci", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "val_count_ci") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_value_name = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("val_count_ci", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_26val_count_ci(__pyx_self, __pyx_v_self, __pyx_v_value_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_26val_count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value_name) { + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_test_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("val_count_ci", 0); + + /* "lib/Naked/toolshed/c/types.pyx":232 + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): + * count = 0 # <<<<<<<<<<<<<< + * for test_value in self.values(): + * try: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_count = __pyx_int_0; + + /* "lib/Naked/toolshed/c/types.pyx":233 + * def val_count_ci(self, value_name): + * count = 0 + * for test_value in self.values(): # <<<<<<<<<<<<<< + * try: + * if value_name.lower() in test_value.lower(): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_test_value, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":234 + * count = 0 + * for test_value in self.values(): + * try: # <<<<<<<<<<<<<< + * if value_name.lower() in test_value.lower(): + * count += 1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":235 + * for test_value in self.values(): + * try: + * if value_name.lower() in test_value.lower(): # <<<<<<<<<<<<<< + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_test_value, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/types.pyx":236 + * try: + * if value_name.lower() in test_value.lower(): + * count += 1 # <<<<<<<<<<<<<< + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + */ + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":237 + * if value_name.lower() in test_value.lower(): + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt # <<<<<<<<<<<<<< + * continue + * return count + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/types.pyx":238 + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue # <<<<<<<<<<<<<< + * return count + * + */ + goto __pyx_L15_except_continue; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L6_exception_handled; + __pyx_L15_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L11_try_continue; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L11_try_continue:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L3_continue; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L12_try_end:; + } + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":239 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + * return count # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_count); + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.val_count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_test_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference = {__Pyx_NAMESTR("difference"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("difference (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_28difference(__pyx_self, __pyx_v_self, __pyx_v_another_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_28difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("difference", 0); + + /* "lib/Naked/toolshed/c/types.pyx":251 + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): + * return set(self.keys()) - set(another_dict.keys()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_another_dict, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection = {__Pyx_NAMESTR("intersection"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_dict = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersection (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_dict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_dict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_dict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_30intersection(__pyx_self, __pyx_v_self, __pyx_v_another_dict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_30intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_dict) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersection", 0); + + /* "lib/Naked/toolshed/c/types.pyx":259 + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): + * return set(self.keys()) & set(another_dict.keys()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_another_dict, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist = {__Pyx_NAMESTR("key_xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("key_xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_32key_xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_32key_xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("key_xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":267 + * #------------------------------------------------------------------------------ + * def key_xlist(self): + * return XList(self.keys(), self._getAttributeDict()) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.key_xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_35random(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_35random = {__Pyx_NAMESTR("random"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_35random, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_35random(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_34random(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_34random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_random = NULL; + CYTHON_UNUSED PyObject *__pyx_v_py_major_version = NULL; + PyObject *__pyx_v_random_key_list = NULL; + PyObject *__pyx_v_the_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random", 0); + + /* "lib/Naked/toolshed/c/types.pyx":275 + * #------------------------------------------------------------------------------ + * def random(self): + * import random # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * random_key_list = random.sample(self.keys(), 1) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":276 + * def random(self): + * import random + * from Naked.toolshed.python import py_major_version # <<<<<<<<<<<<<< + * random_key_list = random.sample(self.keys(), 1) + * the_key = random_key_list[0] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_py_major_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_py_major_version); + __Pyx_GIVEREF(__pyx_n_s_py_major_version); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_python, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_py_major_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_py_major_version = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":277 + * import random + * from Naked.toolshed.python import py_major_version + * random_key_list = random.sample(self.keys(), 1) # <<<<<<<<<<<<<< + * the_key = random_key_list[0] + * return {the_key: self[the_key]} + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_sample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_random_key_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":278 + * from Naked.toolshed.python import py_major_version + * random_key_list = random.sample(self.keys(), 1) + * the_key = random_key_list[0] # <<<<<<<<<<<<<< + * return {the_key: self[the_key]} + * + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_random_key_list, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_the_key = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":279 + * random_key_list = random.sample(self.keys(), 1) + * the_key = random_key_list[0] + * return {the_key: self[the_key]} # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_the_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_3, __pyx_v_the_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.random", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XDECREF(__pyx_v_py_major_version); + __Pyx_XDECREF(__pyx_v_random_key_list); + __Pyx_XDECREF(__pyx_v_the_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample = {__Pyx_NAMESTR("random_sample"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_number_of_items = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random_sample (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_number_of_items,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number_of_items)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_sample") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_number_of_items = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_36random_sample(__pyx_self, __pyx_v_self, __pyx_v_number_of_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_36random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_v_random_key_list = NULL; + PyObject *__pyx_v_new_dict = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random_sample", 0); + + /* "lib/Naked/toolshed/c/types.pyx":287 + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): + * import random # <<<<<<<<<<<<<< + * random_key_list = random.sample(self.keys(), number_of_items) + * new_dict = {} + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":288 + * def random_sample(self, number_of_items): + * import random + * random_key_list = random.sample(self.keys(), number_of_items) # <<<<<<<<<<<<<< + * new_dict = {} + * for item in random_key_list: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_number_of_items); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_number_of_items); + __Pyx_GIVEREF(__pyx_v_number_of_items); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_random_key_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":289 + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + * new_dict = {} # <<<<<<<<<<<<<< + * for item in random_key_list: + * new_dict[item] = self[item] + */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_new_dict = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":290 + * random_key_list = random.sample(self.keys(), number_of_items) + * new_dict = {} + * for item in random_key_list: # <<<<<<<<<<<<<< + * new_dict[item] = self[item] + * return new_dict + */ + if (PyList_CheckExact(__pyx_v_random_key_list) || PyTuple_CheckExact(__pyx_v_random_key_list)) { + __pyx_t_3 = __pyx_v_random_key_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_random_key_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":291 + * new_dict = {} + * for item in random_key_list: + * new_dict[item] = self[item] # <<<<<<<<<<<<<< + * return new_dict + * + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_self, __pyx_v_item); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_v_new_dict, __pyx_v_item, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":292 + * for item in random_key_list: + * new_dict[item] = self[item] + * return new_dict # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_new_dict); + __pyx_r = __pyx_v_new_dict; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XDECREF(__pyx_v_random_key_list); + __Pyx_XDECREF(__pyx_v_new_dict); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems = {__Pyx_NAMESTR("xitems"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xitems (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_38xitems(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_38xitems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_py_major_version = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xitems", 0); + + /* "lib/Naked/toolshed/c/types.pyx":301 + * #------------------------------------------------------------------------------ + * def xitems(self): + * from Naked.toolshed.python import py_major_version # <<<<<<<<<<<<<< + * if py_major_version() > 2: + * return self.items() + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_py_major_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_py_major_version); + __Pyx_GIVEREF(__pyx_n_s_py_major_version); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_toolshed_python, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_py_major_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_py_major_version = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":302 + * def xitems(self): + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: # <<<<<<<<<<<<<< + * return self.items() + * else: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_py_major_version, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/types.pyx":303 + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + * return self.items() # <<<<<<<<<<<<<< + * else: + * return self.iteritems() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":305 + * return self.items() + * else: + * return self.iteritems() # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XDict.xitems", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_py_major_version); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XList)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XList)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XList)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_list_obj = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_list_obj,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XList)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_list_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_list_obj = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList___init__(__pyx_self, __pyx_v_self, __pyx_v_list_obj, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":313 + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_list_obj); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_list_obj); + __Pyx_GIVEREF(__pyx_v_list_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":314 + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__ = {__Pyx_NAMESTR("__add__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_lists = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_other_lists = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_other_lists)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_other_lists); + } else { + __pyx_v_other_lists = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__add__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__add__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_other_lists); __pyx_v_other_lists = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_2__add__(__pyx_self, __pyx_v_self, __pyx_v_other_lists); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_other_lists); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_2__add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_lists) { + PyObject *__pyx_v_the_list = NULL; + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__add__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":325 + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): + * try: # <<<<<<<<<<<<<< + * for the_list in other_lists: + * # add attributes if it is an XList + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":326 + * def __add__(self, *other_lists): + * try: + * for the_list in other_lists: # <<<<<<<<<<<<<< + * # add attributes if it is an XList + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + */ + __pyx_t_4 = __pyx_v_other_lists; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + for (;;) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_the_list, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":328 + * for the_list in other_lists: + * # add attributes if it is an XList + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): # <<<<<<<<<<<<<< + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + */ + __pyx_t_7 = PyObject_HasAttr(__pyx_v_the_list, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_7) { + __pyx_t_6 = __Pyx_GetAttr(__pyx_v_the_list, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_XList, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_7; + } + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":329 + * # add attributes if it is an XList + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_the_list, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_attr_dict, __pyx_t_10); + __pyx_t_10 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":330 + * if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_11 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_9 = ((__pyx_t_11 > 0) != 0); + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":331 + * attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * # extend the XList items + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_10 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; + } + for (;;) { + if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_10)) { + if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_10)) { + if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_10)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_12(__pyx_t_10); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":332 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * # extend the XList items + * self.extend(the_list) + */ + __pyx_t_6 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14; + } + __pyx_L14:; + goto __pyx_L13; + } + __pyx_L13:; + + /* "lib/Naked/toolshed/c/types.pyx":334 + * setattr(self, key, attr_dict[key]) + * # extend the XList items + * self.extend(the_list) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_the_list); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_the_list); + __Pyx_GIVEREF(__pyx_v_the_list); + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":335 + * # extend the XList items + * self.extend(the_list) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":336 + * self.extend(the_list) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_15) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_14, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_14); + __pyx_v_e = __pyx_t_14; + + /* "lib/Naked/toolshed/c/types.pyx":337 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_9) { + + /* "lib/Naked/toolshed/c/types.pyx":338 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_stderr); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L19; + } + __pyx_L19:; + + /* "lib/Naked/toolshed/c/types.pyx":339 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_the_list); + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__ = {__Pyx_NAMESTR("__iadd__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_list = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_list,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__iadd__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_list = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_4__iadd__(__pyx_self, __pyx_v_self, __pyx_v_another_list); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iadd__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":346 + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): + * try: # <<<<<<<<<<<<<< + * #add attributes if it is an XList + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + */ + { + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":348 + * try: + * #add attributes if it is an XList + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): # <<<<<<<<<<<<<< + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + */ + __pyx_t_4 = PyObject_HasAttr(__pyx_v_another_list, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (__pyx_t_4) { + __pyx_t_5 = __Pyx_GetAttr(__pyx_v_another_list, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_XList, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __pyx_t_6; + } else { + __pyx_t_7 = __pyx_t_4; + } + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":349 + * #add attributes if it is an XList + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary # <<<<<<<<<<<<<< + * if len(attr_dict) > 0: + * for key in attr_dict: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_another_list, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_attr_dict = __pyx_t_8; + __pyx_t_8 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":350 + * if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: # <<<<<<<<<<<<<< + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) + */ + __pyx_t_9 = PyObject_Length(__pyx_v_attr_dict); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_7 = ((__pyx_t_9 > 0) != 0); + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":351 + * attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + * if len(attr_dict) > 0: + * for key in attr_dict: # <<<<<<<<<<<<<< + * setattr(self, key, attr_dict[key]) + * # extend the XList items + */ + if (PyList_CheckExact(__pyx_v_attr_dict) || PyTuple_CheckExact(__pyx_v_attr_dict)) { + __pyx_t_8 = __pyx_v_attr_dict; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_attr_dict); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; + } + for (;;) { + if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_10(__pyx_t_8); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5); + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":352 + * if len(attr_dict) > 0: + * for key in attr_dict: + * setattr(self, key, attr_dict[key]) # <<<<<<<<<<<<<< + * # extend the XList items + * self.extend(another_list) + */ + __pyx_t_5 = PyObject_GetItem(__pyx_v_attr_dict, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_v_key, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12; + } + __pyx_L12:; + goto __pyx_L11; + } + __pyx_L11:; + + /* "lib/Naked/toolshed/c/types.pyx":354 + * setattr(self, key, attr_dict[key]) + * # extend the XList items + * self.extend(another_list) # <<<<<<<<<<<<<< + * return self + * except Exception as e: + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_another_list); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_another_list); + __Pyx_GIVEREF(__pyx_v_another_list); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":355 + * # extend the XList items + * self.extend(another_list) + * return self # <<<<<<<<<<<<<< + * except Exception as e: + * if DEBUG_FLAG: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L7_try_return; + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":356 + * self.extend(another_list) + * return self + * except Exception as e: # <<<<<<<<<<<<<< + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + */ + __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception); + if (__pyx_t_13) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __pyx_v_e = __pyx_t_5; + + /* "lib/Naked/toolshed/c/types.pyx":357 + * return self + * except Exception as e: + * if DEBUG_FLAG: # <<<<<<<<<<<<<< + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEBUG_FLAG); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":358 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_stderr); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_write); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + goto __pyx_L17; + } + __pyx_L17:; + + /* "lib/Naked/toolshed/c/types.pyx":359 + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + * raise e # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_Raise(__pyx_v_e, 0, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L10_try_end:; + } + + /* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__ = {__Pyx_NAMESTR("__eq__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":365 + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): + * return self.equals(other_obj) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__ = {__Pyx_NAMESTR("__ne__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_8__ne__(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_8__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__ne__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":371 + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): + * result = self.equals(other_obj) # <<<<<<<<<<<<<< + * if result: + * return False # reverse result of the equals method + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":372 + * def __ne__(self, other_obj): + * result = self.equals(other_obj) + * if result: # <<<<<<<<<<<<<< + * return False # reverse result of the equals method + * else: + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_4) { + + /* "lib/Naked/toolshed/c/types.pyx":373 + * result = self.equals(other_obj) + * if result: + * return False # reverse result of the equals method # <<<<<<<<<<<<<< + * else: + * return True + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":375 + * return False # reverse result of the equals method + * else: + * return True # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_11equals = {__Pyx_NAMESTR("equals"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_11equals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_11equals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_obj = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("equals (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_obj,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equals") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_obj = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("equals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_10equals(__pyx_self, __pyx_v_self, __pyx_v_other_obj); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_10equals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("equals", 0); + + /* "lib/Naked/toolshed/c/types.pyx":382 + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): # <<<<<<<<<<<<<< + * if list(self) == list(other_obj): + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_equal_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_5; + } else { + __pyx_t_6 = __pyx_t_4; + } + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":383 + * def equals(self, other_obj): + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): # <<<<<<<<<<<<<< + * return True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_other_obj); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_obj); + __Pyx_GIVEREF(__pyx_v_other_obj); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":384 + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + * return True # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":386 + * return True + * else: + * return False # <<<<<<<<<<<<<< + * else: + * return False + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":388 + * return False + * else: + * return False # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.equals", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_13join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_13join = {__Pyx_NAMESTR("join"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_13join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_13join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_separator = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_separator,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)((PyObject*)__pyx_kp_s__5)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_separator); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_separator = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("join", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_12join(__pyx_self, __pyx_v_self, __pyx_v_separator); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_12join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_separator) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("join", 0); + + /* "lib/Naked/toolshed/c/types.pyx":403 + * #------------------------------------------------------------------------------ + * def join(self, separator=""): + * return separator.join(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_separator, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix = {__Pyx_NAMESTR("postfix"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_after = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("postfix (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_after,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("postfix", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "postfix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_after = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("postfix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.postfix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_14postfix(__pyx_self, __pyx_v_self, __pyx_v_after); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_14postfix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_after) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("postfix", 0); + + /* "lib/Naked/toolshed/c/types.pyx":410 + * #------------------------------------------------------------------------------ + * def postfix(self, after): + * return [ "".join([x, after]) for x in self ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_x); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_after); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_after); + __Pyx_GIVEREF(__pyx_v_after); + __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.postfix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix = {__Pyx_NAMESTR("prefix"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_before = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("prefix (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_before,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_before)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("prefix", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prefix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_before = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("prefix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.prefix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_16prefix(__pyx_self, __pyx_v_self, __pyx_v_before); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_16prefix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("prefix", 0); + + /* "lib/Naked/toolshed/c/types.pyx":417 + * #------------------------------------------------------------------------------ + * def prefix(self, before): + * return [ "".join([before, x]) for x in self ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_before); + PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_before); + __Pyx_GIVEREF(__pyx_v_before); + __Pyx_INCREF(__pyx_v_x); + PyList_SET_ITEM(__pyx_t_5, 1, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.prefix", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_19surround(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_19surround = {__Pyx_NAMESTR("surround"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_19surround, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_19surround(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_before = 0; + PyObject *__pyx_v_after = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("surround (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_before,&__pyx_n_s_after,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)((PyObject*)__pyx_kp_s__5)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_before)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("surround", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "surround") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_before = values[1]; + __pyx_v_after = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("surround", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.surround", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_18surround(__pyx_self, __pyx_v_self, __pyx_v_before, __pyx_v_after); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_18surround(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_before, PyObject *__pyx_v_after) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("surround", 0); + __Pyx_INCREF(__pyx_v_after); + + /* "lib/Naked/toolshed/c/types.pyx":424 + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): + * if after == "": # <<<<<<<<<<<<<< + * after = before + * return [ "".join([before, x, after]) for x in self ] + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_after, __pyx_kp_s__5, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_1) { + + /* "lib/Naked/toolshed/c/types.pyx":425 + * def surround(self, before, after=""): + * if after == "": + * after = before # <<<<<<<<<<<<<< + * return [ "".join([before, x, after]) for x in self ] + * + */ + __Pyx_INCREF(__pyx_v_before); + __Pyx_DECREF_SET(__pyx_v_after, __pyx_v_before); + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":426 + * if after == "": + * after = before + * return [ "".join([before, x, after]) for x in self ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_3 = __pyx_v_self; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_before); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_before); + __Pyx_GIVEREF(__pyx_v_before); + __Pyx_INCREF(__pyx_v_x); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_after); + PyList_SET_ITEM(__pyx_t_6, 2, __pyx_v_after); + __Pyx_GIVEREF(__pyx_v_after); + __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.surround", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_after); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_21max(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_21max = {__Pyx_NAMESTR("max"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_21max, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_21max(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("max (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_20max(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_20max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("max", 0); + + /* "lib/Naked/toolshed/c/types.pyx":435 + * #------------------------------------------------------------------------------ + * def max(self): + * return max(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_23min(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_23min = {__Pyx_NAMESTR("min"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_23min, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_23min(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("min (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_22min(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_22min(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("min", 0); + + /* "lib/Naked/toolshed/c/types.pyx":442 + * #------------------------------------------------------------------------------ + * def min(self): + * return min(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_25sum(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_25sum = {__Pyx_NAMESTR("sum"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_25sum, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_25sum(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sum (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_24sum(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_24sum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sum", 0); + + /* "lib/Naked/toolshed/c/types.pyx":449 + * #------------------------------------------------------------------------------ + * def sum(self): + * return sum(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates = {__Pyx_NAMESTR("count_duplicates"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_duplicates (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_26count_duplicates(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_26count_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_duplicates", 0); + + /* "lib/Naked/toolshed/c/types.pyx":459 + * #------------------------------------------------------------------------------ + * def count_duplicates(self): + * return len(self) - len(set(self)) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PySet_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_1 - __pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates = {__Pyx_NAMESTR("remove_duplicates"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove_duplicates (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_28remove_duplicates(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_28remove_duplicates(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("remove_duplicates", 0); + + /* "lib/Naked/toolshed/c/types.pyx":466 + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): + * return XList( set(self), self._getAttributeDict() ) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.remove_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_31difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_31difference = {__Pyx_NAMESTR("difference"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_31difference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_31difference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_list = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("difference (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_list,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_list = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("difference", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_30difference(__pyx_self, __pyx_v_self, __pyx_v_another_list); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_30difference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("difference", 0); + + /* "lib/Naked/toolshed/c/types.pyx":473 + * #------------------------------------------------------------------------------ + * def difference(self, another_list): + * return set(self) - set(another_list) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_another_list); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_another_list); + __Pyx_GIVEREF(__pyx_v_another_list); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection = {__Pyx_NAMESTR("intersection"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_list = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersection (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_list,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_list)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_list = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("intersection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_32intersection(__pyx_self, __pyx_v_self, __pyx_v_another_list); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_32intersection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_list) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersection", 0); + + /* "lib/Naked/toolshed/c/types.pyx":480 + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): + * return set(self) & set(another_list) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_another_list); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_another_list); + __Pyx_GIVEREF(__pyx_v_another_list); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items = {__Pyx_NAMESTR("map_to_items"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("map_to_items (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mapped_function,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("map_to_items", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_to_items") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_mapped_function = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("map_to_items", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_34map_to_items(__pyx_self, __pyx_v_self, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_34map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("map_to_items", 0); + + /* "lib/Naked/toolshed/c/types.pyx":491 + * def map_to_items(self, mapped_function): + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): # <<<<<<<<<<<<<< + * self[index] = mapped_function(item) + * return self + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_1); + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":492 + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + * self[index] = mapped_function(item) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_index, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":493 + * for index, item in enumerate(self): + * self[index] = mapped_function(item) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items = {__Pyx_NAMESTR("conditional_map_to_items"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_conditional_function = 0; + PyObject *__pyx_v_mapped_function = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("conditional_map_to_items (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_conditional_function,&__pyx_n_s_mapped_function,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_items", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mapped_function)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("conditional_map_to_items", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conditional_map_to_items") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_conditional_function = values[1]; + __pyx_v_mapped_function = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("conditional_map_to_items", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.conditional_map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_36conditional_map_to_items(__pyx_self, __pyx_v_self, __pyx_v_conditional_function, __pyx_v_mapped_function); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_36conditional_map_to_items(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_conditional_function, PyObject *__pyx_v_mapped_function) { + PyObject *__pyx_v_index = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("conditional_map_to_items", 0); + + /* "lib/Naked/toolshed/c/types.pyx":501 + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): + * for index, item in enumerate(self): # <<<<<<<<<<<<<< + * if conditional_function(item): + * self[index] = mapped_function(item) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_1 = __pyx_int_0; + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; + } + for (;;) { + if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_1); + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":502 + * def conditional_map_to_items(self, conditional_function, mapped_function): + * for index, item in enumerate(self): + * if conditional_function(item): # <<<<<<<<<<<<<< + * self[index] = mapped_function(item) + * return self + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_conditional_function, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_7) { + + /* "lib/Naked/toolshed/c/types.pyx":503 + * for index, item in enumerate(self): + * if conditional_function(item): + * self[index] = mapped_function(item) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_mapped_function, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(PyObject_SetItem(__pyx_v_self, __pyx_v_index, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L5; + } + __pyx_L5:; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":504 + * if conditional_function(item): + * self[index] = mapped_function(item) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.conditional_map_to_items", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci = {__Pyx_NAMESTR("count_ci"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_test_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("count_ci (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_test_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("count_ci", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count_ci") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_test_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("count_ci", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_38count_ci(__pyx_self, __pyx_v_self, __pyx_v_test_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_38count_ci(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_test_string) { + PyObject *__pyx_v_count = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("count_ci", 0); + + /* "lib/Naked/toolshed/c/types.pyx":514 + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): + * count = 0 # <<<<<<<<<<<<<< + * for item in self: + * try: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_count = __pyx_int_0; + + /* "lib/Naked/toolshed/c/types.pyx":515 + * def count_ci(self, test_string): + * count = 0 + * for item in self: # <<<<<<<<<<<<<< + * try: + * if test_string.lower() in item.lower(): + */ + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_1 = __pyx_v_self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; + } + for (;;) { + if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":516 + * count = 0 + * for item in self: + * try: # <<<<<<<<<<<<<< + * if test_string.lower() in item.lower(): + * count += 1 + */ + { + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "lib/Naked/toolshed/c/types.pyx":517 + * for item in self: + * try: + * if test_string.lower() in item.lower(): # <<<<<<<<<<<<<< + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_test_string, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_lower); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_t_8, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (__pyx_t_10 != 0); + if (__pyx_t_11) { + + /* "lib/Naked/toolshed/c/types.pyx":518 + * try: + * if test_string.lower() in item.lower(): + * count += 1 # <<<<<<<<<<<<<< + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + */ + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_9); + __pyx_t_9 = 0; + goto __pyx_L13; + } + __pyx_L13:; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":519 + * if test_string.lower() in item.lower(): + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt # <<<<<<<<<<<<<< + * continue + * return count + */ + __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_12) { + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_4); + + /* "lib/Naked/toolshed/c/types.pyx":520 + * count += 1 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue # <<<<<<<<<<<<<< + * return count + * + */ + goto __pyx_L15_except_continue; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L6_exception_handled; + __pyx_L15_except_continue:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_continue; + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L11_try_continue:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L3_continue; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L12_try_end:; + } + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":521 + * except AttributeError: # the test_value was not a string, catch exception and continue count attempt + * continue + * return count # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_count); + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.count_ci", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_count); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_41random(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_41random = {__Pyx_NAMESTR("random"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_41random, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_41random(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_40random(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_40random(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random", 0); + + /* "lib/Naked/toolshed/c/types.pyx":528 + * #------------------------------------------------------------------------------ + * def random(self): + * import random # <<<<<<<<<<<<<< + * return random.choice(self) + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":529 + * def random(self): + * import random + * return random.choice(self) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_choice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.random", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample = {__Pyx_NAMESTR("random_sample"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_number_of_items = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("random_sample (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_number_of_items,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_number_of_items)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_sample") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_number_of_items = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("random_sample", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_42random_sample(__pyx_self, __pyx_v_self, __pyx_v_number_of_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_42random_sample(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_number_of_items) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("random_sample", 0); + + /* "lib/Naked/toolshed/c/types.pyx":537 + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): + * import random # <<<<<<<<<<<<<< + * return random.sample(self, number_of_items) + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":538 + * def random_sample(self, number_of_items): + * import random + * return random.sample(self, number_of_items) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_number_of_items); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_number_of_items); + __Pyx_GIVEREF(__pyx_v_number_of_items); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle = {__Pyx_NAMESTR("shuffle"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("shuffle (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_44shuffle(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_44shuffle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_random = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("shuffle", 0); + + /* "lib/Naked/toolshed/c/types.pyx":545 + * #------------------------------------------------------------------------------ + * def shuffle(self): + * import random # <<<<<<<<<<<<<< + * random.shuffle(self) + * return self + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_random, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_random = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":546 + * def shuffle(self): + * import random + * random.shuffle(self) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_random, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":547 + * import random + * random.shuffle(self) + * return self # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_random); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match = {__Pyx_NAMESTR("wildcard_match"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_wildcard = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wildcard_match (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wildcard,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wildcard)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wildcard_match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_wildcard = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_46wildcard_match(__pyx_self, __pyx_v_self, __pyx_v_wildcard); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_46wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard) { + PyObject *__pyx_v_fnmatchcase = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wildcard_match", 0); + + /* "lib/Naked/toolshed/c/types.pyx":557 + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): + * if hasattr(self, 'nkd_fnmatchcase'): # <<<<<<<<<<<<<< + * fnmatchcase = self.nkd_fnmatchcase + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":558 + * def wildcard_match(self, wildcard): + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase # <<<<<<<<<<<<<< + * else: + * from fnmatch import fnmatchcase + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":560 + * fnmatchcase = self.nkd_fnmatchcase + * else: + * from fnmatch import fnmatchcase # <<<<<<<<<<<<<< + * self.nkd_fnmatchcase = fnmatchcase + * return [ x for x in self if fnmatchcase(x, wildcard) ] + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_fnmatchcase); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_fnmatchcase); + __Pyx_GIVEREF(__pyx_n_s_fnmatchcase); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_fnmatch, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":561 + * else: + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase # <<<<<<<<<<<<<< + * return [ x for x in self if fnmatchcase(x, wildcard) ] + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase, __pyx_v_fnmatchcase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":562 + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase + * return [ x for x in self if fnmatchcase(x, wildcard) ] # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_3 = __pyx_v_self; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_wildcard); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_wildcard); + __Pyx_GIVEREF(__pyx_v_wildcard); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_fnmatchcase, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fnmatchcase); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match = {__Pyx_NAMESTR("multi_wildcard_match"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_wildcards = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("multi_wildcard_match (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wildcards,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wildcards)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("multi_wildcard_match", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multi_wildcard_match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_wildcards = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("multi_wildcard_match", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.multi_wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_48multi_wildcard_match(__pyx_self, __pyx_v_self, __pyx_v_wildcards); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_48multi_wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcards) { + PyObject *__pyx_v_fnmatchcase = NULL; + PyObject *__pyx_v_wc_list = NULL; + PyObject *__pyx_v_return_list = NULL; + PyObject *__pyx_v_wc = NULL; + PyObject *__pyx_v_temp_list = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("multi_wildcard_match", 0); + + /* "lib/Naked/toolshed/c/types.pyx":569 + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): + * if hasattr(self, 'nkd_fnmatchcase'): # <<<<<<<<<<<<<< + * fnmatchcase = self.nkd_fnmatchcase + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":570 + * def multi_wildcard_match(self, wildcards): + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase # <<<<<<<<<<<<<< + * else: + * from fnmatch import fnmatchcase + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":572 + * fnmatchcase = self.nkd_fnmatchcase + * else: + * from fnmatch import fnmatchcase # <<<<<<<<<<<<<< + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') + */ + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_n_s_fnmatchcase); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_fnmatchcase); + __Pyx_GIVEREF(__pyx_n_s_fnmatchcase); + __pyx_t_4 = __Pyx_Import(__pyx_n_s_fnmatch, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_fnmatchcase = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":573 + * else: + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase # <<<<<<<<<<<<<< + * wc_list = wildcards.split('|') + * return_list = [] + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nkd_fnmatchcase, __pyx_v_fnmatchcase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":574 + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') # <<<<<<<<<<<<<< + * return_list = [] + * for wc in wc_list: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_wildcards, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_wc_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":575 + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') + * return_list = [] # <<<<<<<<<<<<<< + * for wc in wc_list: + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_return_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":576 + * wc_list = wildcards.split('|') + * return_list = [] + * for wc in wc_list: # <<<<<<<<<<<<<< + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + * for result in temp_list: + */ + if (PyList_CheckExact(__pyx_v_wc_list) || PyTuple_CheckExact(__pyx_v_wc_list)) { + __pyx_t_3 = __pyx_v_wc_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_wc_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_wc, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":577 + * return_list = [] + * for wc in wc_list: + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] # <<<<<<<<<<<<<< + * for result in temp_list: + * return_list.append(result) + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyList_CheckExact(__pyx_v_self) || PyTuple_CheckExact(__pyx_v_self)) { + __pyx_t_7 = __pyx_v_self; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; + } + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_7)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_7)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_10 = __pyx_t_9(__pyx_t_7); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_x); + __Pyx_GIVEREF(__pyx_v_x); + __Pyx_INCREF(__pyx_v_wc); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_wc); + __Pyx_GIVEREF(__pyx_v_wc); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_v_fnmatchcase, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_2) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_v_x))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L8; + } + __pyx_L8:; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_temp_list, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":578 + * for wc in wc_list: + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + * for result in temp_list: # <<<<<<<<<<<<<< + * return_list.append(result) + * return return_list + */ + __pyx_t_4 = __pyx_v_temp_list; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; + for (;;) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":579 + * temp_list = [ x for x in self if fnmatchcase(x, wc) ] + * for result in temp_list: + * return_list.append(result) # <<<<<<<<<<<<<< + * return return_list + * + */ + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_return_list, __pyx_v_result); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":580 + * for result in temp_list: + * return_list.append(result) + * return return_list # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_return_list); + __pyx_r = __pyx_v_return_list; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.multi_wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fnmatchcase); + __Pyx_XDECREF(__pyx_v_wc_list); + __Pyx_XDECREF(__pyx_v_return_list); + __Pyx_XDECREF(__pyx_v_wc); + __Pyx_XDECREF(__pyx_v_temp_list); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_51xset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_51xset = {__Pyx_NAMESTR("xset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_51xset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_51xset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_50xset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_50xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":590 + * #------------------------------------------------------------------------------ + * def xset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XSet(set(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":591 + * def xset(self): + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset = {__Pyx_NAMESTR("xfset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xfset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_52xfset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_52xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xfset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":598 + * #------------------------------------------------------------------------------ + * def xfset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XFSet(set(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":599 + * def xfset(self): + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XFSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple = {__Pyx_NAMESTR("xtuple"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xtuple (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_54xtuple(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_54xtuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xtuple", 0); + + /* "lib/Naked/toolshed/c/types.pyx":606 + * #------------------------------------------------------------------------------ + * def xtuple(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XTuple(tuple(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":607 + * def xtuple(self): + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XTuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XList.xtuple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XMaxHeap)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XMaxHeap)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XMaxHeap)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[3] = {0,0,0}; + __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_attributes; + values[2] = ((PyObject *)((PyObject*)__pyx_n_s_XMaxHeap)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_attributes = values[1]; + __pyx_v_naked_type = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap___init__(__pyx_self, __pyx_v_self, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":616 + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * self._queue = [] + * self._index = 0 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":617 + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] # <<<<<<<<<<<<<< + * self._index = 0 + * + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_queue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":618 + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + * self._index = 0 # <<<<<<<<<<<<<< + * + * # length of the queue + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__ = {__Pyx_NAMESTR("__len__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_2__len__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":622 + * # length of the queue + * def __len__(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push = {__Pyx_NAMESTR("push"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("push (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_4push(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("push", 0); + + /* "lib/Naked/toolshed/c/types.pyx":626 + * # O(log n) complexity + * def push(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Negative(__pyx_v_priority); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":627 + * def push(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop = {__Pyx_NAMESTR("pop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pop (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_6pop(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":631 + * # O(log n) complexity + * def pop(self): + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":632 + * def pop(self): + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":634 + * return heappop(self._queue)[-1] + * else: + * return None # <<<<<<<<<<<<<< + * + * # push new object and return the highest priority object + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop = {__Pyx_NAMESTR("pushpop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pushpop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushpop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_8pushpop(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pushpop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":638 + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * if self._queue: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Negative(__pyx_v_priority); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":639 + * def pushpop(self, the_object, priority): + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":640 + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":641 + * self._index += 1 + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None # return None if the queue is empty + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":643 + * return heappop(self._queue)[-1] + * else: + * return None # return None if the queue is empty # <<<<<<<<<<<<<< + * + * # the length of the queue + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length = {__Pyx_NAMESTR("length"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("length (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_10length(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("length", 0); + + /* "lib/Naked/toolshed/c/types.pyx":647 + * # the length of the queue + * def length(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMaxHeap.length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XMinHeap)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XMinHeap)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XMinHeap)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[3] = {0,0,0}; + __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_attributes; + values[2] = ((PyObject *)((PyObject*)__pyx_n_s_XMinHeap)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_attributes = values[1]; + __pyx_v_naked_type = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap___init__(__pyx_self, __pyx_v_self, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":656 + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * self._queue = [] + * self._index = 0 + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":657 + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] # <<<<<<<<<<<<<< + * self._index = 0 + * + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_queue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":658 + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + * self._index = 0 # <<<<<<<<<<<<<< + * + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__ = {__Pyx_NAMESTR("__len__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_2__len__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":663 + * # length of the queue + * def __len__(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push = {__Pyx_NAMESTR("push"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("push (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("push", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_4push(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_4push(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("push", 0); + + /* "lib/Naked/toolshed/c/types.pyx":667 + * # O(log n) complexity + * def push(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":668 + * def push(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * + * # O(log n) complexity + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.push", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop = {__Pyx_NAMESTR("pop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pop (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_6pop(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_6pop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":672 + * # O(log n) complexity + * def pop(self): + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":673 + * def pop(self): + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None # return None if the queue is empty + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":675 + * return heappop(self._queue)[-1] + * else: + * return None # return None if the queue is empty # <<<<<<<<<<<<<< + * + * # push new object and return the lowest priority object + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop = {__Pyx_NAMESTR("pushpop"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_object = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("pushpop (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_object,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_object)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushpop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_the_object = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("pushpop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_8pushpop(__pyx_self, __pyx_v_self, __pyx_v_the_object, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_8pushpop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_object, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("pushpop", 0); + + /* "lib/Naked/toolshed/c/types.pyx":679 + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) # <<<<<<<<<<<<<< + * self._index += 1 + * if self._queue: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_the_object); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_the_object); + __Pyx_GIVEREF(__pyx_v_the_object); + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":680 + * def pushpop(self, the_object, priority): + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":681 + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + * if self._queue: # <<<<<<<<<<<<<< + * return heappop(self._queue)[-1] + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":682 + * self._index += 1 + * if self._queue: + * return heappop(self._queue)[-1] # <<<<<<<<<<<<<< + * else: + * return None #return None if the queue is empty + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":684 + * return heappop(self._queue)[-1] + * else: + * return None #return None if the queue is empty # <<<<<<<<<<<<<< + * + * # the length of the queue + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.pushpop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length = {__Pyx_NAMESTR("length"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("length (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_10length(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_10length(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("length", 0); + + /* "lib/Naked/toolshed/c/types.pyx":688 + * # the length of the queue + * def length(self): + * return len(self._queue) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XMinHeap.length", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_initial_iterable); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_initial_iterable); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_initial_iterable); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject *)__pyx_int_10)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_int_10)); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XQueue)); + PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject*)__pyx_n_s_XQueue)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XQueue)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XQueue.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_initial_iterable = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_max_length = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_initial_iterable,&__pyx_n_s_attributes,&__pyx_n_s_max_length,&__pyx_n_s_naked_type,0}; + PyObject* values[5] = {0,0,0,0,0}; + __pyx_defaults5 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_initial_iterable; + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject *)__pyx_int_10)); + values[4] = ((PyObject *)((PyObject*)__pyx_n_s_XQueue)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_initial_iterable); + if (value) { values[1] = value; kw_args--; } + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_length); + if (value) { values[3] = value; kw_args--; } + } + case 4: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_initial_iterable = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_max_length = values[3]; + __pyx_v_naked_type = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue___init__(__pyx_self, __pyx_v_self, __pyx_v_initial_iterable, __pyx_v_attributes, __pyx_v_max_length, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_initial_iterable, PyObject *__pyx_v_attributes, PyObject *__pyx_v_max_length, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":698 + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_deque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_initial_iterable); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_initial_iterable); + __Pyx_GIVEREF(__pyx_v_initial_iterable); + __Pyx_INCREF(__pyx_v_max_length); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_max_length); + __Pyx_GIVEREF(__pyx_v_max_length); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":699 + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XSet)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XSet)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XSet)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_set_obj = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set_obj,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults6 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XSet)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_set_obj)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_set_obj = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet___init__(__pyx_self, __pyx_v_self, __pyx_v_set_obj, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set_obj, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":709 + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_set_obj); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_set_obj); + __Pyx_GIVEREF(__pyx_v_set_obj); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":710 + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) # <<<<<<<<<<<<<< + * + * # << operator is overloaded to extend the XSet with a second set + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __Pyx_INCREF(__pyx_v_naked_type); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_naked_type); + __Pyx_GIVEREF(__pyx_v_naked_type); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__ = {__Pyx_NAMESTR("__lshift__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_set = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_set,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_set)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__lshift__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__lshift__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_set = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__lshift__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_2__lshift__(__pyx_self, __pyx_v_self, __pyx_v_another_set); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_2__lshift__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__lshift__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":714 + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): + * self.update(another_set) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_another_set); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_another_set); + __Pyx_GIVEREF(__pyx_v_another_set); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":715 + * def __lshift__(self, another_set): + * self.update(another_set) + * return self # <<<<<<<<<<<<<< + * + * # += operator overload to extend the XSet with a second set + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__ = {__Pyx_NAMESTR("__iadd__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_another_set = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_another_set,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_another_set)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__iadd__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_another_set = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__iadd__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_4__iadd__(__pyx_self, __pyx_v_self, __pyx_v_another_set); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_4__iadd__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_another_set) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__iadd__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":719 + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): + * self.update(another_set) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_another_set); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_another_set); + __Pyx_GIVEREF(__pyx_v_another_set); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":720 + * def __iadd__(self, another_set): + * self.update(another_set) + * return self # <<<<<<<<<<<<<< + * + * def xlist(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist = {__Pyx_NAMESTR("xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_6xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_6xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":723 + * + * def xlist(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XList(list(self), attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":724 + * def xlist(self): + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) # <<<<<<<<<<<<<< + * + * def xfset(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset = {__Pyx_NAMESTR("xfset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xfset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_8xfset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_8xfset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xfset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":727 + * + * def xfset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XFSet(self, attr_dict) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":728 + * def xfset(self): + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XFSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XSet.xfset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XFSet)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XFSet)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XFSet)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_set = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_set,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults7 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XFSet)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_set)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_set = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_set, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_set, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_set_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":737 + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_set); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_set); + __Pyx_GIVEREF(__pyx_v_the_set); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_set_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":738 + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(set_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":739 + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(set_obj, key, attributes[key]) + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":740 + * if len(attributes) > 0: + * for key in attributes: + * setattr(set_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + * return set_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_set_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":741 + * for key in attributes: + * setattr(set_obj, key, attributes[key]) + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) # <<<<<<<<<<<<<< + * return set_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_set_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":742 + * setattr(set_obj, key, attributes[key]) + * setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + * return set_obj # <<<<<<<<<<<<<< + * + * def _getAttributeDict(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_set_obj); + __pyx_r = __pyx_v_set_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_set_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":745 + * + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * def xlist(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist = {__Pyx_NAMESTR("xlist"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xlist (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_4xlist(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_4xlist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xlist", 0); + + /* "lib/Naked/toolshed/c/types.pyx":748 + * + * def xlist(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XList(list(self), attr_dict, naked_type="XList") + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":749 + * def xlist(self): + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") # <<<<<<<<<<<<<< + * + * def xset(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XList); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_naked_type, __pyx_n_s_XList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.xlist", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset = {__Pyx_NAMESTR("xset"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xset (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_6xset(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_6xset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_attr_dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xset", 0); + + /* "lib/Naked/toolshed/c/types.pyx":752 + * + * def xset(self): + * attr_dict = self._getAttributeDict() # <<<<<<<<<<<<<< + * return XSet(self, attr_dict, naked_type="XSet") + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getAttributeDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_attr_dict = __pyx_t_2; + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":753 + * def xset(self): + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_XSet); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_attr_dict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_attr_dict); + __Pyx_GIVEREF(__pyx_v_attr_dict); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_naked_type, __pyx_n_s_XSet) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.xset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_attr_dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_8type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_8type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":760 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":761 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":763 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XFSet.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_22__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XString)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XString)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XString)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_string_text = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults8 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XString)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString___new__(__pyx_self, __pyx_v_cls, __pyx_v_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_str_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":775 + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_string_text); + __Pyx_GIVEREF(__pyx_v_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_str_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":776 + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":777 + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":778 + * if len(attributes) > 0: + * for key in attributes: + * setattr(str_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(str_obj, '_naked_type_', naked_type) + * return str_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":779 + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # <<<<<<<<<<<<<< + * return str_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":780 + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) + * return str_obj # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_str_obj); + __pyx_r = __pyx_v_str_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":787 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_5type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_5type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_5type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_5type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_4type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":794 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":795 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":797 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * ## TODO: see where + vs. join breakpoint becomes important + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_7concat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_7concat = {__Pyx_NAMESTR("concat"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_7concat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_7concat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_strings = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("concat (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_strings = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_strings)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_strings); + } else { + __pyx_v_strings = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "concat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("concat", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_strings); __pyx_v_strings = 0; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.concat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_6concat(__pyx_self, __pyx_v_self, __pyx_v_strings); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_strings); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_6concat(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_strings) { + PyObject *__pyx_v_str_list = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("concat", 0); + + /* "lib/Naked/toolshed/c/types.pyx":801 + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): + * str_list = [] # <<<<<<<<<<<<<< + * for x in strings: + * str_list.append(x) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_str_list = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":802 + * def concat(self, *strings): + * str_list = [] + * for x in strings: # <<<<<<<<<<<<<< + * str_list.append(x) + * return "".join(str_list) + */ + __pyx_t_1 = __pyx_v_strings; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":803 + * str_list = [] + * for x in strings: + * str_list.append(x) # <<<<<<<<<<<<<< + * return "".join(str_list) + * + */ + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_str_list, __pyx_v_x); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":804 + * for x in strings: + * str_list.append(x) + * return "".join(str_list) # <<<<<<<<<<<<<< + * + * # fastest substring search truth test + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_v_str_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.concat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_list); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_9contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_9contains = {__Pyx_NAMESTR("contains"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_9contains, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_9contains(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_substring = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("contains (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_substring,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_substring)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("contains", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contains") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_substring = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("contains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_8contains(__pyx_self, __pyx_v_self, __pyx_v_substring); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_8contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_substring) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("contains", 0); + + /* "lib/Naked/toolshed/c/types.pyx":808 + * # fastest substring search truth test + * def contains(self, substring): + * return substring in self # <<<<<<<<<<<<<< + * + * # split the string on one or more delimiters, return list + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_substring, __pyx_v_self, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit = {__Pyx_NAMESTR("xsplit"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_split_delimiter = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xsplit (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_split_delimiter,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_split_delimiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("xsplit", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xsplit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_split_delimiter = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xsplit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_10xsplit(__pyx_self, __pyx_v_self, __pyx_v_split_delimiter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_10xsplit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_v_re = NULL; + PyObject *__pyx_v_delim2 = NULL; + PyObject *__pyx_v_first_list = NULL; + PyObject *__pyx_v_result_list = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_subitem = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xsplit", 0); + __Pyx_INCREF(__pyx_v_split_delimiter); + + /* "lib/Naked/toolshed/c/types.pyx":813 + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): + * length = len(split_delimiter) # <<<<<<<<<<<<<< + * if length > 2: + * import re + */ + __pyx_t_1 = PyObject_Length(__pyx_v_split_delimiter); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_length = __pyx_t_1; + + /* "lib/Naked/toolshed/c/types.pyx":814 + * def xsplit(self, split_delimiter): + * length = len(split_delimiter) + * if length > 2: # <<<<<<<<<<<<<< + * import re + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + */ + __pyx_t_2 = ((__pyx_v_length > 2) != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":815 + * length = len(split_delimiter) + * if length > 2: + * import re # <<<<<<<<<<<<<< + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + * return re.split(split_delimiter, self) + */ + __pyx_t_3 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_re = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":816 + * if length > 2: + * import re + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) # <<<<<<<<<<<<<< + * return re.split(split_delimiter, self) + * elif length > 1: + */ + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_kp_s__8); + PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s__8); + __Pyx_GIVEREF(__pyx_kp_s__8); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __Pyx_INCREF(__pyx_kp_s__9); + PyList_SET_ITEM(__pyx_t_3, 2, __pyx_kp_s__9); + __Pyx_GIVEREF(__pyx_kp_s__9); + __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_split_delimiter, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":817 + * import re + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + * return re.split(split_delimiter, self) # <<<<<<<<<<<<<< + * elif length > 1: + * delim2 = split_delimiter[1] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_re, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":818 + * split_delimiter = "".join([ '[', split_delimiter, ']' ]) + * return re.split(split_delimiter, self) + * elif length > 1: # <<<<<<<<<<<<<< + * delim2 = split_delimiter[1] + * first_list = self.split(split_delimiter[0]) + */ + __pyx_t_2 = ((__pyx_v_length > 1) != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":819 + * return re.split(split_delimiter, self) + * elif length > 1: + * delim2 = split_delimiter[1] # <<<<<<<<<<<<<< + * first_list = self.split(split_delimiter[0]) + * result_list = [] + */ + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_split_delimiter, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_delim2 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":820 + * elif length > 1: + * delim2 = split_delimiter[1] + * first_list = self.split(split_delimiter[0]) # <<<<<<<<<<<<<< + * result_list = [] + * for item in first_list: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_split_delimiter, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_first_list = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":821 + * delim2 = split_delimiter[1] + * first_list = self.split(split_delimiter[0]) + * result_list = [] # <<<<<<<<<<<<<< + * for item in first_list: + * for subitem in item.split(delim2): + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result_list = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":822 + * first_list = self.split(split_delimiter[0]) + * result_list = [] + * for item in first_list: # <<<<<<<<<<<<<< + * for subitem in item.split(delim2): + * result_list.append(subitem) + */ + if (PyList_CheckExact(__pyx_v_first_list) || PyTuple_CheckExact(__pyx_v_first_list)) { + __pyx_t_3 = __pyx_v_first_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_first_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_4 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":823 + * result_list = [] + * for item in first_list: + * for subitem in item.split(delim2): # <<<<<<<<<<<<<< + * result_list.append(subitem) + * return result_list + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_delim2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_delim2); + __Pyx_GIVEREF(__pyx_v_delim2); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + for (;;) { + if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_7 = __pyx_t_9(__pyx_t_5); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_subitem, __pyx_t_7); + __pyx_t_7 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":824 + * for item in first_list: + * for subitem in item.split(delim2): + * result_list.append(subitem) # <<<<<<<<<<<<<< + * return result_list + * else: + */ + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_v_subitem); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":825 + * for subitem in item.split(delim2): + * result_list.append(subitem) + * return result_list # <<<<<<<<<<<<<< + * else: + * return self.split(split_delimiter) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result_list); + __pyx_r = __pyx_v_result_list; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":827 + * return result_list + * else: + * return self.split(split_delimiter) # <<<<<<<<<<<<<< + * + * # split the string on one or more characters and return items in set + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_re); + __Pyx_XDECREF(__pyx_v_delim2); + __Pyx_XDECREF(__pyx_v_first_list); + __Pyx_XDECREF(__pyx_v_result_list); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_subitem); + __Pyx_XDECREF(__pyx_v_split_delimiter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set = {__Pyx_NAMESTR("xsplit_set"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_split_delimiter = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("xsplit_set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_split_delimiter,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_split_delimiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("xsplit_set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xsplit_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_split_delimiter = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("xsplit_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_12xsplit_set(__pyx_self, __pyx_v_self, __pyx_v_split_delimiter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_12xsplit_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_split_delimiter) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("xsplit_set", 0); + + /* "lib/Naked/toolshed/c/types.pyx":831 + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): + * return set(self.xsplit(split_delimiter)) # <<<<<<<<<<<<<< + * + * # str begins with substring - faster than str.startswith() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xsplit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_split_delimiter); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_split_delimiter); + __Pyx_GIVEREF(__pyx_v_split_delimiter); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.xsplit_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_15begins(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_15begins = {__Pyx_NAMESTR("begins"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_15begins, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_15begins(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_begin_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("begins (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_begin_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_begin_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("begins", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begins") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_begin_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("begins", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.begins", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_14begins(__pyx_self, __pyx_v_self, __pyx_v_begin_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_14begins(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_begin_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("begins", 0); + + /* "lib/Naked/toolshed/c/types.pyx":835 + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): + * return begin_string in self[0:len(begin_string)] # <<<<<<<<<<<<<< + * + * # str ends with substring - faster than str.endswith() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_Length(__pyx_v_begin_string); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_self, 0, __pyx_t_1, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_begin_string, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.begins", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_17ends(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_17ends = {__Pyx_NAMESTR("ends"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_17ends, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_17ends(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_end_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ends (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_end_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("ends", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ends") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_end_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("ends", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.ends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_16ends(__pyx_self, __pyx_v_self, __pyx_v_end_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_16ends(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_end_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("ends", 0); + + /* "lib/Naked/toolshed/c/types.pyx":839 + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): + * return end_string in self[-len(end_string):] # <<<<<<<<<<<<<< + * + * # case sensitive wildcard match on the XString (boolean returned) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_Length(__pyx_v_end_string); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_self, (-__pyx_t_1), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_end_string, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.ends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match = {__Pyx_NAMESTR("wildcard_match"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_wildcard = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wildcard_match (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_wildcard,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_wildcard)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wildcard_match") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_wildcard = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wildcard_match", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_18wildcard_match(__pyx_self, __pyx_v_self, __pyx_v_wildcard); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_18wildcard_match(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_wildcard) { + PyObject *__pyx_v_fnmatchcase = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("wildcard_match", 0); + + /* "lib/Naked/toolshed/c/types.pyx":843 + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): + * from fnmatch import fnmatchcase # <<<<<<<<<<<<<< + * return fnmatchcase(self, wildcard) + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_fnmatchcase); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_fnmatchcase); + __Pyx_GIVEREF(__pyx_n_s_fnmatchcase); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_fnmatch, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_fnmatchcase = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":844 + * def wildcard_match(self, wildcard): + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) # <<<<<<<<<<<<<< + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __Pyx_INCREF(__pyx_v_wildcard); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_wildcard); + __Pyx_GIVEREF(__pyx_v_wildcard); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_fnmatchcase, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.wildcard_match", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fnmatchcase); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode = {__Pyx_NAMESTR("unicode"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unicode (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_20unicode(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_20unicode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_version_info = NULL; + PyObject *__pyx_v_normalize = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("unicode", 0); + + /* "lib/Naked/toolshed/c/types.pyx":848 + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): + * from sys import version_info # <<<<<<<<<<<<<< + * from unicodedata import normalize + * if version_info[0] == 2: + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_version_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info); + __Pyx_GIVEREF(__pyx_n_s_version_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_version_info = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":849 + * def unicode(self): + * from sys import version_info + * from unicodedata import normalize # <<<<<<<<<<<<<< + * if version_info[0] == 2: + * return normalize('NFKD', self.decode('UTF-8')) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_normalize); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_normalize); + __Pyx_GIVEREF(__pyx_n_s_normalize); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_unicodedata, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_normalize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_normalize = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":850 + * from sys import version_info + * from unicodedata import normalize + * if version_info[0] == 2: # <<<<<<<<<<<<<< + * return normalize('NFKD', self.decode('UTF-8')) + * else: + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_version_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + /* "lib/Naked/toolshed/c/types.pyx":851 + * from unicodedata import normalize + * if version_info[0] == 2: + * return normalize('NFKD', self.decode('UTF-8')) # <<<<<<<<<<<<<< + * else: + * return normalize('NFKD', self) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_normalize, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":853 + * return normalize('NFKD', self.decode('UTF-8')) + * else: + * return normalize('NFKD', self) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_normalize, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XString.unicode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_version_info); + __Pyx_XDECREF(__pyx_v_normalize); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_14__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XUnicode)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XUnicode)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XUnicode)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_string_text = 0; + PyObject *__pyx_v_attributes = 0; + CYTHON_UNUSED PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults9 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XUnicode)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode___init__(__pyx_self, __pyx_v_self, __pyx_v_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XUnicode2)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XUnicode2)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XUnicode2)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_2.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_string_text = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XUnicode2)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_2.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_str_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":865 + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyUnicode_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_string_text); + __Pyx_GIVEREF(__pyx_v_the_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_str_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":866 + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":867 + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":868 + * if len(attributes) > 0: + * for key in attributes: + * setattr(str_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + * return str_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":869 + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings # <<<<<<<<<<<<<< + * return str_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":870 + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + * return str_obj # <<<<<<<<<<<<<< + * + * class XUnicode_3(str): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_str_obj); + __pyx_r = __pyx_v_str_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_2.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XUnicode3)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XUnicode3)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XUnicode3)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_3.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_string_text = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_string_text,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XUnicode3)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_string_text)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_string_text = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_3.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_string_text, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_string_text, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_str_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":874 + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_string_text); + __Pyx_GIVEREF(__pyx_v_the_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_str_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":875 + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":876 + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":877 + * if len(attributes) > 0: + * for key in attributes: + * setattr(str_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + * return str_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":878 + * for key in attributes: + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings # <<<<<<<<<<<<<< + * return str_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_str_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":879 + * setattr(str_obj, key, attributes[key]) + * setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + * return str_obj # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_str_obj); + __pyx_r = __pyx_v_str_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__.XUnicode_3.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_str_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_string_text, PyObject *__pyx_v_attributes, CYTHON_UNUSED PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_sys = NULL; + PyObject *__pyx_v_unicodedata = NULL; + PyObject *__pyx_v_norm_text = NULL; + PyObject *__pyx_v_XUnicode_2 = NULL; + PyObject *__pyx_v_XUnicode_3 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":859 + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys # <<<<<<<<<<<<<< + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', string_text) + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sys = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":860 + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys + * import unicodedata # <<<<<<<<<<<<<< + * norm_text = unicodedata.normalize('NFKD', string_text) + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_unicodedata = __pyx_t_1; + __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":861 + * import sys + * import unicodedata + * norm_text = unicodedata.normalize('NFKD', string_text) # <<<<<<<<<<<<<< + * + * class XUnicode_2(unicode): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_unicodedata, __pyx_n_s_normalize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_NFKD); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NFKD); + __Pyx_GIVEREF(__pyx_n_s_NFKD); + __Pyx_INCREF(__pyx_v_string_text); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_string_text); + __Pyx_GIVEREF(__pyx_v_string_text); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_norm_text = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":863 + * norm_text = unicodedata.normalize('NFKD', string_text) + * + * class XUnicode_2(unicode): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyUnicode_Type)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyUnicode_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyUnicode_Type)))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_XUnicode_2, __pyx_n_s_XUnicode___init___locals_XUnicod, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XUnicode___init___locals_XUnicod_2, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults11), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_2_2__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":863 + * norm_text = unicodedata.normalize('NFKD', string_text) + * + * class XUnicode_2(unicode): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + * str_obj = unicode.__new__(cls, the_string_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XUnicode_2, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_XUnicode_2 = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":872 + * return str_obj + * + * class XUnicode_3(str): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type)))); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyString_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type)))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_XUnicode_3, __pyx_n_s_XUnicode___init___locals_XUnicod_3, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XUnicode___init___locals_XUnicod_4, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults12), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__init___10XUnicode_3_2__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":872 + * return str_obj + * + * class XUnicode_3(str): # <<<<<<<<<<<<<< + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + * str_obj = str.__new__(cls, the_string_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XUnicode_3, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_XUnicode_3 = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":882 + * + * + * if sys.version_info[0] == 2: # <<<<<<<<<<<<<< + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":883 + * + * if sys.version_info[0] == 2: + * self.obj = XUnicode_2(norm_text, attributes) # <<<<<<<<<<<<<< + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_XUnicode_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_obj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":884 + * if sys.version_info[0] == 2: + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text # <<<<<<<<<<<<<< + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_norm_unicode, __pyx_v_norm_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":885 + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string # <<<<<<<<<<<<<< + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3; + } + + /* "lib/Naked/toolshed/c/types.pyx":886 + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: # <<<<<<<<<<<<<< + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "lib/Naked/toolshed/c/types.pyx":887 + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_norm_text); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_norm_text); + __Pyx_GIVEREF(__pyx_v_norm_text); + __Pyx_INCREF(__pyx_v_attributes); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_attributes); + __Pyx_GIVEREF(__pyx_v_attributes); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_XUnicode_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_sys); + __Pyx_XDECREF(__pyx_v_unicodedata); + __Pyx_XDECREF(__pyx_v_norm_text); + __Pyx_XDECREF(__pyx_v_XUnicode_2); + __Pyx_XDECREF(__pyx_v_XUnicode_3); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_2__str__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":891 + * def __str__(self): + * # return self.naked_u_string + * return self.obj # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_4__repr__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":894 + * + * def __repr__(self): + * return self.naked_u_string # <<<<<<<<<<<<<< + * + * def __getattr__(self, the_attribute): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__ = {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_the_attribute = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_the_attribute,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_attribute)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_the_attribute = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_6__getattr__(__pyx_self, __pyx_v_self, __pyx_v_the_attribute); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_6__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_the_attribute) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":897 + * + * def __getattr__(self, the_attribute): + * return self.obj.__dict__[the_attribute] # <<<<<<<<<<<<<< + * + * def __cmp__(self, other_string): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_the_attribute); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__ = {__Pyx_NAMESTR("__cmp__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_other_string = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other_string,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_string)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cmp__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cmp__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_other_string = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cmp__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__cmp__(__pyx_self, __pyx_v_self, __pyx_v_other_string); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_8__cmp__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other_string) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + Py_hash_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__cmp__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":900 + * + * def __cmp__(self, other_string): + * return hash(self.naked_u_string) == hash(other_string) # <<<<<<<<<<<<<< + * # TODO: add check for same attributes + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_u_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_Hash(__pyx_v_other_string); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_2 == __pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_10_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_10_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":908 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_12type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_12type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":915 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":916 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":918 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XUnicode.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_attributes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_attributes); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_attributes); + __Pyx_INCREF(((PyObject*)__pyx_n_s_XTuple)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_s_XTuple)); + __Pyx_GIVEREF(((PyObject*)__pyx_n_s_XTuple)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_the_tuple = 0; + PyObject *__pyx_v_attributes = 0; + PyObject *__pyx_v_naked_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_the_tuple,&__pyx_n_s_attributes,&__pyx_n_s_naked_type,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self); + values[2] = __pyx_dynamic_args->__pyx_arg_attributes; + values[3] = ((PyObject *)((PyObject*)__pyx_n_s_XTuple)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_the_tuple)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attributes); + if (value) { values[2] = value; kw_args--; } + } + case 3: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_naked_type); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cls = values[0]; + __pyx_v_the_tuple = values[1]; + __pyx_v_attributes = values[2]; + __pyx_v_naked_type = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple___new__(__pyx_self, __pyx_v_cls, __pyx_v_the_tuple, __pyx_v_attributes, __pyx_v_naked_type); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_the_tuple, PyObject *__pyx_v_attributes, PyObject *__pyx_v_naked_type) { + PyObject *__pyx_v_tup_obj = NULL; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "lib/Naked/toolshed/c/types.pyx":927 + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + __Pyx_INCREF(__pyx_v_the_tuple); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_the_tuple); + __Pyx_GIVEREF(__pyx_v_the_tuple); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tup_obj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":928 + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: # <<<<<<<<<<<<<< + * for key in attributes: + * setattr(tup_obj, key, attributes[key]) + */ + __pyx_t_4 = PyObject_Length(__pyx_v_attributes); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((__pyx_t_4 > 0) != 0); + if (__pyx_t_5) { + + /* "lib/Naked/toolshed/c/types.pyx":929 + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + * for key in attributes: # <<<<<<<<<<<<<< + * setattr(tup_obj, key, attributes[key]) + * setattr(tup_obj, '_naked_type_', naked_type) + */ + if (PyList_CheckExact(__pyx_v_attributes) || PyTuple_CheckExact(__pyx_v_attributes)) { + __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; + } + for (;;) { + if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_COMPILING_IN_CPYTHON + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); + __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":930 + * if len(attributes) > 0: + * for key in attributes: + * setattr(tup_obj, key, attributes[key]) # <<<<<<<<<<<<<< + * setattr(tup_obj, '_naked_type_', naked_type) + * return tup_obj + */ + __pyx_t_2 = PyObject_GetItem(__pyx_v_attributes, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_SetAttr(__pyx_v_tup_obj, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "lib/Naked/toolshed/c/types.pyx":931 + * for key in attributes: + * setattr(tup_obj, key, attributes[key]) + * setattr(tup_obj, '_naked_type_', naked_type) # <<<<<<<<<<<<<< + * return tup_obj + * + */ + __pyx_t_7 = PyObject_SetAttr(__pyx_v_tup_obj, __pyx_n_s_naked_type_2, __pyx_v_naked_type); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":932 + * setattr(tup_obj, key, attributes[key]) + * setattr(tup_obj, '_naked_type_', naked_type) + * return tup_obj # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_tup_obj); + __pyx_r = __pyx_v_tup_obj; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup_obj); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict = {__Pyx_NAMESTR("_getAttributeDict"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getAttributeDict (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_2_getAttributeDict(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_2_getAttributeDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_getAttributeDict", 0); + + /* "lib/Naked/toolshed/c/types.pyx":939 + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): + * return self.__dict__ # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple._getAttributeDict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type = {__Pyx_NAMESTR("type"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("type (wrapper)", 0); + __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_4type(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_4type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("type", 0); + + /* "lib/Naked/toolshed/c/types.pyx":946 + * #------------------------------------------------------------------------------ + * def type(self): + * if hasattr(self, '_naked_type_'): # <<<<<<<<<<<<<< + * return self._naked_type_ + * else: + */ + __pyx_t_1 = PyObject_HasAttr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "lib/Naked/toolshed/c/types.pyx":947 + * def type(self): + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ # <<<<<<<<<<<<<< + * else: + * return None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_naked_type_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + /*else*/ { + + /* "lib/Naked/toolshed/c/types.pyx":949 + * return self._naked_type_ + * else: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + } + + /* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("lib.Naked.toolshed.c.types.XTuple.type", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef __pyx_moduledef = { + #if PY_VERSION_HEX < 0x03020000 + { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, + #else + PyModuleDef_HEAD_INIT, + #endif + __Pyx_NAMESTR("types"), + 0, /* m_doc */ + -1, /* m_size */ + __pyx_methods /* m_methods */, + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_DEBUG_FLAG, __pyx_k_DEBUG_FLAG, sizeof(__pyx_k_DEBUG_FLAG), 0, 0, 1, 1}, + {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1}, + {&__pyx_n_s_NFKD, __pyx_k_NFKD, sizeof(__pyx_k_NFKD), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject, __pyx_k_NakedObject, sizeof(__pyx_k_NakedObject), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject___eq, __pyx_k_NakedObject___eq, sizeof(__pyx_k_NakedObject___eq), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject___init, __pyx_k_NakedObject___init, sizeof(__pyx_k_NakedObject___init), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject___ne, __pyx_k_NakedObject___ne, sizeof(__pyx_k_NakedObject___ne), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject__equal_attributes, __pyx_k_NakedObject__equal_attributes, sizeof(__pyx_k_NakedObject__equal_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject__equal_type, __pyx_k_NakedObject__equal_type, sizeof(__pyx_k_NakedObject__equal_type), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject__getAttributeDict, __pyx_k_NakedObject__getAttributeDict, sizeof(__pyx_k_NakedObject__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject_equals, __pyx_k_NakedObject_equals, sizeof(__pyx_k_NakedObject_equals), 0, 0, 1, 1}, + {&__pyx_n_s_NakedObject_type, __pyx_k_NakedObject_type, sizeof(__pyx_k_NakedObject_type), 0, 0, 1, 1}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to, __pyx_k_Naked_Framework_Error_unable_to, sizeof(__pyx_k_Naked_Framework_Error_unable_to), 0, 0, 1, 0}, + {&__pyx_kp_s_Naked_Framework_Error_unable_to_2, __pyx_k_Naked_Framework_Error_unable_to_2, sizeof(__pyx_k_Naked_Framework_Error_unable_to_2), 0, 0, 1, 0}, + {&__pyx_n_s_Naked_settings, __pyx_k_Naked_settings, sizeof(__pyx_k_Naked_settings), 0, 0, 1, 1}, + {&__pyx_n_s_Naked_toolshed_python, __pyx_k_Naked_toolshed_python, sizeof(__pyx_k_Naked_toolshed_python), 0, 0, 1, 1}, + {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0}, + {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0}, + {&__pyx_n_s_XDict, __pyx_k_XDict, sizeof(__pyx_k_XDict), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___add, __pyx_k_XDict___add, sizeof(__pyx_k_XDict___add), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___eq, __pyx_k_XDict___eq, sizeof(__pyx_k_XDict___eq), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___iadd, __pyx_k_XDict___iadd, sizeof(__pyx_k_XDict___iadd), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___init, __pyx_k_XDict___init, sizeof(__pyx_k_XDict___init), 0, 0, 1, 1}, + {&__pyx_n_s_XDict___ne, __pyx_k_XDict___ne, sizeof(__pyx_k_XDict___ne), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_conditional_map_to_vals, __pyx_k_XDict_conditional_map_to_vals, sizeof(__pyx_k_XDict_conditional_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_difference, __pyx_k_XDict_difference, sizeof(__pyx_k_XDict_difference), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_equals, __pyx_k_XDict_equals, sizeof(__pyx_k_XDict_equals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_intersection, __pyx_k_XDict_intersection, sizeof(__pyx_k_XDict_intersection), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_key_xlist, __pyx_k_XDict_key_xlist, sizeof(__pyx_k_XDict_key_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_map_to_vals, __pyx_k_XDict_map_to_vals, sizeof(__pyx_k_XDict_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_max_val, __pyx_k_XDict_max_val, sizeof(__pyx_k_XDict_max_val), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_min_val, __pyx_k_XDict_min_val, sizeof(__pyx_k_XDict_min_val), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_random, __pyx_k_XDict_random, sizeof(__pyx_k_XDict_random), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_random_sample, __pyx_k_XDict_random_sample, sizeof(__pyx_k_XDict_random_sample), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_sum_vals, __pyx_k_XDict_sum_vals, sizeof(__pyx_k_XDict_sum_vals), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_val_count, __pyx_k_XDict_val_count, sizeof(__pyx_k_XDict_val_count), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_val_count_ci, __pyx_k_XDict_val_count_ci, sizeof(__pyx_k_XDict_val_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_val_xlist, __pyx_k_XDict_val_xlist, sizeof(__pyx_k_XDict_val_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XDict_xitems, __pyx_k_XDict_xitems, sizeof(__pyx_k_XDict_xitems), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet, __pyx_k_XFSet, sizeof(__pyx_k_XFSet), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet___new, __pyx_k_XFSet___new, sizeof(__pyx_k_XFSet___new), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet__getAttributeDict, __pyx_k_XFSet__getAttributeDict, sizeof(__pyx_k_XFSet__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet_type, __pyx_k_XFSet_type, sizeof(__pyx_k_XFSet_type), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet_xlist, __pyx_k_XFSet_xlist, sizeof(__pyx_k_XFSet_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XFSet_xset, __pyx_k_XFSet_xset, sizeof(__pyx_k_XFSet_xset), 0, 0, 1, 1}, + {&__pyx_n_s_XList, __pyx_k_XList, sizeof(__pyx_k_XList), 0, 0, 1, 1}, + {&__pyx_n_s_XList___add, __pyx_k_XList___add, sizeof(__pyx_k_XList___add), 0, 0, 1, 1}, + {&__pyx_n_s_XList___eq, __pyx_k_XList___eq, sizeof(__pyx_k_XList___eq), 0, 0, 1, 1}, + {&__pyx_n_s_XList___iadd, __pyx_k_XList___iadd, sizeof(__pyx_k_XList___iadd), 0, 0, 1, 1}, + {&__pyx_n_s_XList___init, __pyx_k_XList___init, sizeof(__pyx_k_XList___init), 0, 0, 1, 1}, + {&__pyx_n_s_XList___ne, __pyx_k_XList___ne, sizeof(__pyx_k_XList___ne), 0, 0, 1, 1}, + {&__pyx_n_s_XList_conditional_map_to_items, __pyx_k_XList_conditional_map_to_items, sizeof(__pyx_k_XList_conditional_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_XList_count_ci, __pyx_k_XList_count_ci, sizeof(__pyx_k_XList_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_XList_count_duplicates, __pyx_k_XList_count_duplicates, sizeof(__pyx_k_XList_count_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_XList_difference, __pyx_k_XList_difference, sizeof(__pyx_k_XList_difference), 0, 0, 1, 1}, + {&__pyx_n_s_XList_equals, __pyx_k_XList_equals, sizeof(__pyx_k_XList_equals), 0, 0, 1, 1}, + {&__pyx_n_s_XList_intersection, __pyx_k_XList_intersection, sizeof(__pyx_k_XList_intersection), 0, 0, 1, 1}, + {&__pyx_n_s_XList_join, __pyx_k_XList_join, sizeof(__pyx_k_XList_join), 0, 0, 1, 1}, + {&__pyx_n_s_XList_map_to_items, __pyx_k_XList_map_to_items, sizeof(__pyx_k_XList_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_XList_max, __pyx_k_XList_max, sizeof(__pyx_k_XList_max), 0, 0, 1, 1}, + {&__pyx_n_s_XList_min, __pyx_k_XList_min, sizeof(__pyx_k_XList_min), 0, 0, 1, 1}, + {&__pyx_n_s_XList_multi_wildcard_match, __pyx_k_XList_multi_wildcard_match, sizeof(__pyx_k_XList_multi_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_XList_postfix, __pyx_k_XList_postfix, sizeof(__pyx_k_XList_postfix), 0, 0, 1, 1}, + {&__pyx_n_s_XList_prefix, __pyx_k_XList_prefix, sizeof(__pyx_k_XList_prefix), 0, 0, 1, 1}, + {&__pyx_n_s_XList_random, __pyx_k_XList_random, sizeof(__pyx_k_XList_random), 0, 0, 1, 1}, + {&__pyx_n_s_XList_random_sample, __pyx_k_XList_random_sample, sizeof(__pyx_k_XList_random_sample), 0, 0, 1, 1}, + {&__pyx_n_s_XList_remove_duplicates, __pyx_k_XList_remove_duplicates, sizeof(__pyx_k_XList_remove_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_XList_shuffle, __pyx_k_XList_shuffle, sizeof(__pyx_k_XList_shuffle), 0, 0, 1, 1}, + {&__pyx_n_s_XList_sum, __pyx_k_XList_sum, sizeof(__pyx_k_XList_sum), 0, 0, 1, 1}, + {&__pyx_n_s_XList_surround, __pyx_k_XList_surround, sizeof(__pyx_k_XList_surround), 0, 0, 1, 1}, + {&__pyx_n_s_XList_wildcard_match, __pyx_k_XList_wildcard_match, sizeof(__pyx_k_XList_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_XList_xfset, __pyx_k_XList_xfset, sizeof(__pyx_k_XList_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_XList_xset, __pyx_k_XList_xset, sizeof(__pyx_k_XList_xset), 0, 0, 1, 1}, + {&__pyx_n_s_XList_xtuple, __pyx_k_XList_xtuple, sizeof(__pyx_k_XList_xtuple), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap, __pyx_k_XMaxHeap, sizeof(__pyx_k_XMaxHeap), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap___init, __pyx_k_XMaxHeap___init, sizeof(__pyx_k_XMaxHeap___init), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap___len, __pyx_k_XMaxHeap___len, sizeof(__pyx_k_XMaxHeap___len), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_length, __pyx_k_XMaxHeap_length, sizeof(__pyx_k_XMaxHeap_length), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_pop, __pyx_k_XMaxHeap_pop, sizeof(__pyx_k_XMaxHeap_pop), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_push, __pyx_k_XMaxHeap_push, sizeof(__pyx_k_XMaxHeap_push), 0, 0, 1, 1}, + {&__pyx_n_s_XMaxHeap_pushpop, __pyx_k_XMaxHeap_pushpop, sizeof(__pyx_k_XMaxHeap_pushpop), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap, __pyx_k_XMinHeap, sizeof(__pyx_k_XMinHeap), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap___init, __pyx_k_XMinHeap___init, sizeof(__pyx_k_XMinHeap___init), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap___len, __pyx_k_XMinHeap___len, sizeof(__pyx_k_XMinHeap___len), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_length, __pyx_k_XMinHeap_length, sizeof(__pyx_k_XMinHeap_length), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_pop, __pyx_k_XMinHeap_pop, sizeof(__pyx_k_XMinHeap_pop), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_push, __pyx_k_XMinHeap_push, sizeof(__pyx_k_XMinHeap_push), 0, 0, 1, 1}, + {&__pyx_n_s_XMinHeap_pushpop, __pyx_k_XMinHeap_pushpop, sizeof(__pyx_k_XMinHeap_pushpop), 0, 0, 1, 1}, + {&__pyx_n_s_XQueue, __pyx_k_XQueue, sizeof(__pyx_k_XQueue), 0, 0, 1, 1}, + {&__pyx_n_s_XQueue___init, __pyx_k_XQueue___init, sizeof(__pyx_k_XQueue___init), 0, 0, 1, 1}, + {&__pyx_n_s_XSet, __pyx_k_XSet, sizeof(__pyx_k_XSet), 0, 0, 1, 1}, + {&__pyx_n_s_XSet___iadd, __pyx_k_XSet___iadd, sizeof(__pyx_k_XSet___iadd), 0, 0, 1, 1}, + {&__pyx_n_s_XSet___init, __pyx_k_XSet___init, sizeof(__pyx_k_XSet___init), 0, 0, 1, 1}, + {&__pyx_n_s_XSet___lshift, __pyx_k_XSet___lshift, sizeof(__pyx_k_XSet___lshift), 0, 0, 1, 1}, + {&__pyx_n_s_XSet_xfset, __pyx_k_XSet_xfset, sizeof(__pyx_k_XSet_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_XSet_xlist, __pyx_k_XSet_xlist, sizeof(__pyx_k_XSet_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_XString, __pyx_k_XString, sizeof(__pyx_k_XString), 0, 0, 1, 1}, + {&__pyx_n_s_XString___new, __pyx_k_XString___new, sizeof(__pyx_k_XString___new), 0, 0, 1, 1}, + {&__pyx_n_s_XString__getAttributeDict, __pyx_k_XString__getAttributeDict, sizeof(__pyx_k_XString__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XString_begins, __pyx_k_XString_begins, sizeof(__pyx_k_XString_begins), 0, 0, 1, 1}, + {&__pyx_n_s_XString_concat, __pyx_k_XString_concat, sizeof(__pyx_k_XString_concat), 0, 0, 1, 1}, + {&__pyx_n_s_XString_contains, __pyx_k_XString_contains, sizeof(__pyx_k_XString_contains), 0, 0, 1, 1}, + {&__pyx_n_s_XString_ends, __pyx_k_XString_ends, sizeof(__pyx_k_XString_ends), 0, 0, 1, 1}, + {&__pyx_n_s_XString_type, __pyx_k_XString_type, sizeof(__pyx_k_XString_type), 0, 0, 1, 1}, + {&__pyx_n_s_XString_unicode, __pyx_k_XString_unicode, sizeof(__pyx_k_XString_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_XString_wildcard_match, __pyx_k_XString_wildcard_match, sizeof(__pyx_k_XString_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_XString_xsplit, __pyx_k_XString_xsplit, sizeof(__pyx_k_XString_xsplit), 0, 0, 1, 1}, + {&__pyx_n_s_XString_xsplit_set, __pyx_k_XString_xsplit_set, sizeof(__pyx_k_XString_xsplit_set), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple, __pyx_k_XTuple, sizeof(__pyx_k_XTuple), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple___new, __pyx_k_XTuple___new, sizeof(__pyx_k_XTuple___new), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple__getAttributeDict, __pyx_k_XTuple__getAttributeDict, sizeof(__pyx_k_XTuple__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XTuple_type, __pyx_k_XTuple_type, sizeof(__pyx_k_XTuple_type), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode, __pyx_k_XUnicode, sizeof(__pyx_k_XUnicode), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode2, __pyx_k_XUnicode2, sizeof(__pyx_k_XUnicode2), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode3, __pyx_k_XUnicode3, sizeof(__pyx_k_XUnicode3), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode_2, __pyx_k_XUnicode_2, sizeof(__pyx_k_XUnicode_2), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode_3, __pyx_k_XUnicode_3, sizeof(__pyx_k_XUnicode_3), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___cmp, __pyx_k_XUnicode___cmp, sizeof(__pyx_k_XUnicode___cmp), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___getattr, __pyx_k_XUnicode___getattr, sizeof(__pyx_k_XUnicode___getattr), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init, __pyx_k_XUnicode___init, sizeof(__pyx_k_XUnicode___init), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod, __pyx_k_XUnicode___init___locals_XUnicod, sizeof(__pyx_k_XUnicode___init___locals_XUnicod), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod_2, __pyx_k_XUnicode___init___locals_XUnicod_2, sizeof(__pyx_k_XUnicode___init___locals_XUnicod_2), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod_3, __pyx_k_XUnicode___init___locals_XUnicod_3, sizeof(__pyx_k_XUnicode___init___locals_XUnicod_3), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___init___locals_XUnicod_4, __pyx_k_XUnicode___init___locals_XUnicod_4, sizeof(__pyx_k_XUnicode___init___locals_XUnicod_4), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___repr, __pyx_k_XUnicode___repr, sizeof(__pyx_k_XUnicode___repr), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode___str, __pyx_k_XUnicode___str, sizeof(__pyx_k_XUnicode___str), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode__getAttributeDict, __pyx_k_XUnicode__getAttributeDict, sizeof(__pyx_k_XUnicode__getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_XUnicode_type, __pyx_k_XUnicode_type, sizeof(__pyx_k_XUnicode_type), 0, 0, 1, 1}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0}, + {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1}, + {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, + {&__pyx_n_s_another_dict, __pyx_k_another_dict, sizeof(__pyx_k_another_dict), 0, 0, 1, 1}, + {&__pyx_n_s_another_list, __pyx_k_another_list, sizeof(__pyx_k_another_list), 0, 0, 1, 1}, + {&__pyx_n_s_another_set, __pyx_k_another_set, sizeof(__pyx_k_another_set), 0, 0, 1, 1}, + {&__pyx_n_s_attr_dict, __pyx_k_attr_dict, sizeof(__pyx_k_attr_dict), 0, 0, 1, 1}, + {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1}, + {&__pyx_n_s_begin_string, __pyx_k_begin_string, sizeof(__pyx_k_begin_string), 0, 0, 1, 1}, + {&__pyx_n_s_begins, __pyx_k_begins, sizeof(__pyx_k_begins), 0, 0, 1, 1}, + {&__pyx_n_s_choice, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_concat, __pyx_k_concat, sizeof(__pyx_k_concat), 0, 0, 1, 1}, + {&__pyx_n_s_conditional_function, __pyx_k_conditional_function, sizeof(__pyx_k_conditional_function), 0, 0, 1, 1}, + {&__pyx_n_s_conditional_map_to_items, __pyx_k_conditional_map_to_items, sizeof(__pyx_k_conditional_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_conditional_map_to_vals, __pyx_k_conditional_map_to_vals, sizeof(__pyx_k_conditional_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_count_ci, __pyx_k_count_ci, sizeof(__pyx_k_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_count_duplicates, __pyx_k_count_duplicates, sizeof(__pyx_k_count_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_delim2, __pyx_k_delim2, sizeof(__pyx_k_delim2), 0, 0, 1, 1}, + {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dict_obj, __pyx_k_dict_obj, sizeof(__pyx_k_dict_obj), 0, 0, 1, 1}, + {&__pyx_n_s_difference, __pyx_k_difference, sizeof(__pyx_k_difference), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end_string, __pyx_k_end_string, sizeof(__pyx_k_end_string), 0, 0, 1, 1}, + {&__pyx_n_s_ends, __pyx_k_ends, sizeof(__pyx_k_ends), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1}, + {&__pyx_n_s_equal_attributes, __pyx_k_equal_attributes, sizeof(__pyx_k_equal_attributes), 0, 0, 1, 1}, + {&__pyx_n_s_equal_type, __pyx_k_equal_type, sizeof(__pyx_k_equal_type), 0, 0, 1, 1}, + {&__pyx_n_s_equals, __pyx_k_equals, sizeof(__pyx_k_equals), 0, 0, 1, 1}, + {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, + {&__pyx_n_s_first_list, __pyx_k_first_list, sizeof(__pyx_k_first_list), 0, 0, 1, 1}, + {&__pyx_n_s_fnmatch, __pyx_k_fnmatch, sizeof(__pyx_k_fnmatch), 0, 0, 1, 1}, + {&__pyx_n_s_fnmatchcase, __pyx_k_fnmatchcase, sizeof(__pyx_k_fnmatchcase), 0, 0, 1, 1}, + {&__pyx_n_s_getAttributeDict, __pyx_k_getAttributeDict, sizeof(__pyx_k_getAttributeDict), 0, 0, 1, 1}, + {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1}, + {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, + {&__pyx_n_s_heappush, __pyx_k_heappush, sizeof(__pyx_k_heappush), 0, 0, 1, 1}, + {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, + {&__pyx_n_s_iadd, __pyx_k_iadd, sizeof(__pyx_k_iadd), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, + {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_initial_iterable, __pyx_k_initial_iterable, sizeof(__pyx_k_initial_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_key_xlist, __pyx_k_key_xlist, sizeof(__pyx_k_key_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1}, + {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, + {&__pyx_n_s_lib_Naked_toolshed_c_types, __pyx_k_lib_Naked_toolshed_c_types, sizeof(__pyx_k_lib_Naked_toolshed_c_types), 0, 0, 1, 1}, + {&__pyx_n_s_list_obj, __pyx_k_list_obj, sizeof(__pyx_k_list_obj), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_lshift, __pyx_k_lshift, sizeof(__pyx_k_lshift), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_map_to_items, __pyx_k_map_to_items, sizeof(__pyx_k_map_to_items), 0, 0, 1, 1}, + {&__pyx_n_s_map_to_vals, __pyx_k_map_to_vals, sizeof(__pyx_k_map_to_vals), 0, 0, 1, 1}, + {&__pyx_n_s_mapped_function, __pyx_k_mapped_function, sizeof(__pyx_k_mapped_function), 0, 0, 1, 1}, + {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_max_length, __pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 0, 1, 1}, + {&__pyx_n_s_max_val, __pyx_k_max_val, sizeof(__pyx_k_max_val), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, + {&__pyx_n_s_min_val, __pyx_k_min_val, sizeof(__pyx_k_min_val), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_multi_wildcard_match, __pyx_k_multi_wildcard_match, sizeof(__pyx_k_multi_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_naked_type, __pyx_k_naked_type, sizeof(__pyx_k_naked_type), 0, 0, 1, 1}, + {&__pyx_n_s_naked_type_2, __pyx_k_naked_type_2, sizeof(__pyx_k_naked_type_2), 0, 0, 1, 1}, + {&__pyx_n_s_naked_u_string, __pyx_k_naked_u_string, sizeof(__pyx_k_naked_u_string), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_new_dict, __pyx_k_new_dict, sizeof(__pyx_k_new_dict), 0, 0, 1, 1}, + {&__pyx_n_s_nkd_fnmatchcase, __pyx_k_nkd_fnmatchcase, sizeof(__pyx_k_nkd_fnmatchcase), 0, 0, 1, 1}, + {&__pyx_n_s_norm_text, __pyx_k_norm_text, sizeof(__pyx_k_norm_text), 0, 0, 1, 1}, + {&__pyx_n_s_norm_unicode, __pyx_k_norm_unicode, sizeof(__pyx_k_norm_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_normalize, __pyx_k_normalize, sizeof(__pyx_k_normalize), 0, 0, 1, 1}, + {&__pyx_n_s_number_of_items, __pyx_k_number_of_items, sizeof(__pyx_k_number_of_items), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1}, + {&__pyx_n_s_other_lists, __pyx_k_other_lists, sizeof(__pyx_k_other_lists), 0, 0, 1, 1}, + {&__pyx_n_s_other_obj, __pyx_k_other_obj, sizeof(__pyx_k_other_obj), 0, 0, 1, 1}, + {&__pyx_n_s_other_string, __pyx_k_other_string, sizeof(__pyx_k_other_string), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_postfix, __pyx_k_postfix, sizeof(__pyx_k_postfix), 0, 0, 1, 1}, + {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_push, __pyx_k_push, sizeof(__pyx_k_push), 0, 0, 1, 1}, + {&__pyx_n_s_pushpop, __pyx_k_pushpop, sizeof(__pyx_k_pushpop), 0, 0, 1, 1}, + {&__pyx_n_s_py_major_version, __pyx_k_py_major_version, sizeof(__pyx_k_py_major_version), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, + {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, + {&__pyx_n_s_random_key_list, __pyx_k_random_key_list, sizeof(__pyx_k_random_key_list), 0, 0, 1, 1}, + {&__pyx_n_s_random_sample, __pyx_k_random_sample, sizeof(__pyx_k_random_sample), 0, 0, 1, 1}, + {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, + {&__pyx_n_s_remove_duplicates, __pyx_k_remove_duplicates, sizeof(__pyx_k_remove_duplicates), 0, 0, 1, 1}, + {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_result_list, __pyx_k_result_list, sizeof(__pyx_k_result_list), 0, 0, 1, 1}, + {&__pyx_n_s_return_list, __pyx_k_return_list, sizeof(__pyx_k_return_list), 0, 0, 1, 1}, + {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1}, + {&__pyx_n_s_set_obj, __pyx_k_set_obj, sizeof(__pyx_k_set_obj), 0, 0, 1, 1}, + {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_split_delimiter, __pyx_k_split_delimiter, sizeof(__pyx_k_split_delimiter), 0, 0, 1, 1}, + {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1}, + {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, + {&__pyx_n_s_str_list, __pyx_k_str_list, sizeof(__pyx_k_str_list), 0, 0, 1, 1}, + {&__pyx_n_s_str_obj, __pyx_k_str_obj, sizeof(__pyx_k_str_obj), 0, 0, 1, 1}, + {&__pyx_n_s_string_text, __pyx_k_string_text, sizeof(__pyx_k_string_text), 0, 0, 1, 1}, + {&__pyx_n_s_strings, __pyx_k_strings, sizeof(__pyx_k_strings), 0, 0, 1, 1}, + {&__pyx_n_s_subitem, __pyx_k_subitem, sizeof(__pyx_k_subitem), 0, 0, 1, 1}, + {&__pyx_n_s_substring, __pyx_k_substring, sizeof(__pyx_k_substring), 0, 0, 1, 1}, + {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, + {&__pyx_n_s_sum_vals, __pyx_k_sum_vals, sizeof(__pyx_k_sum_vals), 0, 0, 1, 1}, + {&__pyx_n_s_surround, __pyx_k_surround, sizeof(__pyx_k_surround), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_temp_list, __pyx_k_temp_list, sizeof(__pyx_k_temp_list), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_test_string, __pyx_k_test_string, sizeof(__pyx_k_test_string), 0, 0, 1, 1}, + {&__pyx_n_s_test_value, __pyx_k_test_value, sizeof(__pyx_k_test_value), 0, 0, 1, 1}, + {&__pyx_n_s_the_attribute, __pyx_k_the_attribute, sizeof(__pyx_k_the_attribute), 0, 0, 1, 1}, + {&__pyx_n_s_the_key, __pyx_k_the_key, sizeof(__pyx_k_the_key), 0, 0, 1, 1}, + {&__pyx_n_s_the_list, __pyx_k_the_list, sizeof(__pyx_k_the_list), 0, 0, 1, 1}, + {&__pyx_n_s_the_object, __pyx_k_the_object, sizeof(__pyx_k_the_object), 0, 0, 1, 1}, + {&__pyx_n_s_the_set, __pyx_k_the_set, sizeof(__pyx_k_the_set), 0, 0, 1, 1}, + {&__pyx_n_s_the_string_text, __pyx_k_the_string_text, sizeof(__pyx_k_the_string_text), 0, 0, 1, 1}, + {&__pyx_n_s_the_tuple, __pyx_k_the_tuple, sizeof(__pyx_k_the_tuple), 0, 0, 1, 1}, + {&__pyx_n_s_tup_obj, __pyx_k_tup_obj, sizeof(__pyx_k_tup_obj), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, + {&__pyx_n_s_val_count, __pyx_k_val_count, sizeof(__pyx_k_val_count), 0, 0, 1, 1}, + {&__pyx_n_s_val_count_ci, __pyx_k_val_count_ci, sizeof(__pyx_k_val_count_ci), 0, 0, 1, 1}, + {&__pyx_n_s_val_xlist, __pyx_k_val_xlist, sizeof(__pyx_k_val_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_value_name, __pyx_k_value_name, sizeof(__pyx_k_value_name), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_wc, __pyx_k_wc, sizeof(__pyx_k_wc), 0, 0, 1, 1}, + {&__pyx_n_s_wc_list, __pyx_k_wc_list, sizeof(__pyx_k_wc_list), 0, 0, 1, 1}, + {&__pyx_n_s_wildcard, __pyx_k_wildcard, sizeof(__pyx_k_wildcard), 0, 0, 1, 1}, + {&__pyx_n_s_wildcard_match, __pyx_k_wildcard_match, sizeof(__pyx_k_wildcard_match), 0, 0, 1, 1}, + {&__pyx_n_s_wildcards, __pyx_k_wildcards, sizeof(__pyx_k_wildcards), 0, 0, 1, 1}, + {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_xfset, __pyx_k_xfset, sizeof(__pyx_k_xfset), 0, 0, 1, 1}, + {&__pyx_n_s_xitems, __pyx_k_xitems, sizeof(__pyx_k_xitems), 0, 0, 1, 1}, + {&__pyx_n_s_xlist, __pyx_k_xlist, sizeof(__pyx_k_xlist), 0, 0, 1, 1}, + {&__pyx_n_s_xset, __pyx_k_xset, sizeof(__pyx_k_xset), 0, 0, 1, 1}, + {&__pyx_n_s_xsplit, __pyx_k_xsplit, sizeof(__pyx_k_xsplit), 0, 0, 1, 1}, + {&__pyx_n_s_xsplit_set, __pyx_k_xsplit_set, sizeof(__pyx_k_xsplit_set), 0, 0, 1, 1}, + {&__pyx_n_s_xtuple, __pyx_k_xtuple, sizeof(__pyx_k_xtuple), 0, 0, 1, 1}, + {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "lib/Naked/toolshed/c/types.pyx":107 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "lib/Naked/toolshed/c/types.pyx":126 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "lib/Naked/toolshed/c/types.pyx":338 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "lib/Naked/toolshed/c/types.pyx":358 + * except Exception as e: + * if DEBUG_FLAG: + * sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") # <<<<<<<<<<<<<< + * raise e + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Naked_Framework_Error_unable_to_2); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "lib/Naked/toolshed/c/types.pyx":574 + * from fnmatch import fnmatchcase + * self.nkd_fnmatchcase = fnmatchcase + * wc_list = wildcards.split('|') # <<<<<<<<<<<<<< + * return_list = [] + * for wc in wc_list: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "lib/Naked/toolshed/c/types.pyx":851 + * from unicodedata import normalize + * if version_info[0] == 2: + * return normalize('NFKD', self.decode('UTF-8')) # <<<<<<<<<<<<<< + * else: + * return normalize('NFKD', self) + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "lib/Naked/toolshed/c/types.pyx":864 + * + * class XUnicode_2(unicode): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): # <<<<<<<<<<<<<< + * str_obj = unicode.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_tuple__11 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_str_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":873 + * + * class XUnicode_3(str): + * def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, the_string_text) + * if len(attributes) > 0: + */ + __pyx_tuple__13 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_str_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 873, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":885 + * self.obj = XUnicode_2(norm_text, attributes) + * self.norm_unicode = norm_text + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string # <<<<<<<<<<<<<< + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "lib/Naked/toolshed/c/types.pyx":887 + * self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + * elif sys.version_info[0] == 3: + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_key); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equal_type, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equal_attributes, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_eq, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_obj, __pyx_n_s_result); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ne, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equals, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_dict_obj, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_add, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_other_dict, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_iadd, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_eq, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_obj, __pyx_n_s_result); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ne, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equals, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + __pyx_tuple__45 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_conditional_function, __pyx_n_s_mapped_function, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_conditional_map_to_vals, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mapped_function, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_map_to_vals, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_val_xlist, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_max_val, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_min_val, 202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_sum_vals, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_tuple__57 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value_name, __pyx_n_s_count, __pyx_n_s_test_value); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_val_count, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_tuple__59 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value_name, __pyx_n_s_count, __pyx_n_s_test_value); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_val_count_ci, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_dict); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_difference, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_dict); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_intersection, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_key_xlist, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + __pyx_tuple__67 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_random, __pyx_n_s_py_major_version, __pyx_n_s_random_key_list, __pyx_n_s_the_key); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + __pyx_tuple__69 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_number_of_items, __pyx_n_s_random, __pyx_n_s_random_key_list, __pyx_n_s_new_dict, __pyx_n_s_item); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random_sample, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_py_major_version); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xitems, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__73 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_list_obj, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_other_lists, __pyx_n_s_the_list, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_add, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + __pyx_tuple__77 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_another_list, __pyx_n_s_attr_dict, __pyx_n_s_key, __pyx_n_s_e); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_iadd, 345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_eq, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other_obj, __pyx_n_s_result); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ne, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_obj); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_equals, 381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_separator); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_join, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__87 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__5)); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + + /* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + __pyx_tuple__88 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_after, __pyx_n_s_x); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_postfix, 409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + __pyx_tuple__90 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_x); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_prefix, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + __pyx_tuple__92 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_x); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_surround, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__94 = PyTuple_Pack(1, ((PyObject*)__pyx_kp_s__5)); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__94); + __Pyx_GIVEREF(__pyx_tuple__94); + + /* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_max, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_min, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__99); + __Pyx_GIVEREF(__pyx_tuple__99); + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_sum, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__101); + __Pyx_GIVEREF(__pyx_tuple__101); + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_count_duplicates, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + __pyx_tuple__103 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__103); + __Pyx_GIVEREF(__pyx_tuple__103); + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_remove_duplicates, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + __pyx_tuple__105 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_list); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__105); + __Pyx_GIVEREF(__pyx_tuple__105); + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_difference, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_list); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__107); + __Pyx_GIVEREF(__pyx_tuple__107); + __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_intersection, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + __pyx_tuple__109 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mapped_function, __pyx_n_s_index_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__109); + __Pyx_GIVEREF(__pyx_tuple__109); + __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_map_to_items, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + __pyx_tuple__111 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_conditional_function, __pyx_n_s_mapped_function, __pyx_n_s_index_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__111); + __Pyx_GIVEREF(__pyx_tuple__111); + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_conditional_map_to_items, 500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + __pyx_tuple__113 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_test_string, __pyx_n_s_count, __pyx_n_s_item); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__113); + __Pyx_GIVEREF(__pyx_tuple__113); + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_count_ci, 513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_random); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random, 527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + __pyx_tuple__117 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_number_of_items, __pyx_n_s_random); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__117); + __Pyx_GIVEREF(__pyx_tuple__117); + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_random_sample, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + __pyx_tuple__119 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_random); if (unlikely(!__pyx_tuple__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__119); + __Pyx_GIVEREF(__pyx_tuple__119); + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_shuffle, 544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_tuple__121 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_wildcard, __pyx_n_s_fnmatchcase, __pyx_n_s_x); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wildcard_match, 556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_tuple__123 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_wildcards, __pyx_n_s_fnmatchcase, __pyx_n_s_wc_list, __pyx_n_s_return_list, __pyx_n_s_wc, __pyx_n_s_temp_list, __pyx_n_s_result, __pyx_n_s_x); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_multi_wildcard_match, 568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xset, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + __pyx_tuple__127 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xfset, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xtuple, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_len, 621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__135); + __Pyx_GIVEREF(__pyx_tuple__135); + __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_push, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__137); + __Pyx_GIVEREF(__pyx_tuple__137); + __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pop, 630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__139 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__139); + __Pyx_GIVEREF(__pyx_tuple__139); + __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pushpop, 637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__141); + __Pyx_GIVEREF(__pyx_tuple__141); + __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_length, 646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_tuple__143 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__143); + __Pyx_GIVEREF(__pyx_tuple__143); + __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 655, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_len, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__147); + __Pyx_GIVEREF(__pyx_tuple__147); + __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_push, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__149); + __Pyx_GIVEREF(__pyx_tuple__149); + __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pop, 671, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_tuple__151 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_the_object, __pyx_n_s_priority); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__151); + __Pyx_GIVEREF(__pyx_tuple__151); + __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_pushpop, 678, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__153); + __Pyx_GIVEREF(__pyx_tuple__153); + __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_length, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__155 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_initial_iterable, __pyx_n_s_attributes, __pyx_n_s_max_length, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__155); + __Pyx_GIVEREF(__pyx_tuple__155); + __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_tuple__157 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_set_obj, __pyx_n_s_attributes, __pyx_n_s_naked_type); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_set); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_lshift, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_tuple__161 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_another_set); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__161); + __Pyx_GIVEREF(__pyx_tuple__161); + __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_iadd, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__163); + __Pyx_GIVEREF(__pyx_tuple__163); + __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xlist, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__165); + __Pyx_GIVEREF(__pyx_tuple__165); + __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xfset, 726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + __pyx_tuple__167 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_set, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_set_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__167); + __Pyx_GIVEREF(__pyx_tuple__167); + __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__169); + __Pyx_GIVEREF(__pyx_tuple__169); + __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + __pyx_tuple__171 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__171); + __Pyx_GIVEREF(__pyx_tuple__171); + __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xlist, 747, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr_dict); if (unlikely(!__pyx_tuple__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__173); + __Pyx_GIVEREF(__pyx_tuple__173); + __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xset, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__175 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__175); + __Pyx_GIVEREF(__pyx_tuple__175); + __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + __pyx_tuple__177 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_str_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__177); + __Pyx_GIVEREF(__pyx_tuple__177); + __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__179); + __Pyx_GIVEREF(__pyx_tuple__179); + __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__181); + __Pyx_GIVEREF(__pyx_tuple__181); + __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + __pyx_tuple__183 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_strings, __pyx_n_s_str_list, __pyx_n_s_x); if (unlikely(!__pyx_tuple__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__183); + __Pyx_GIVEREF(__pyx_tuple__183); + __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_concat, 800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + __pyx_tuple__185 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_substring); if (unlikely(!__pyx_tuple__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__185); + __Pyx_GIVEREF(__pyx_tuple__185); + __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_contains, 807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + __pyx_tuple__187 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_split_delimiter, __pyx_n_s_length, __pyx_n_s_re, __pyx_n_s_delim2, __pyx_n_s_first_list, __pyx_n_s_result_list, __pyx_n_s_item, __pyx_n_s_subitem); if (unlikely(!__pyx_tuple__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__187); + __Pyx_GIVEREF(__pyx_tuple__187); + __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xsplit, 812, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_split_delimiter); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__189); + __Pyx_GIVEREF(__pyx_tuple__189); + __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_xsplit_set, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_begin_string); if (unlikely(!__pyx_tuple__191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__191); + __Pyx_GIVEREF(__pyx_tuple__191); + __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_begins, 834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + __pyx_tuple__193 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_end_string); if (unlikely(!__pyx_tuple__193)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__193); + __Pyx_GIVEREF(__pyx_tuple__193); + __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_ends, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + __pyx_tuple__195 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_wildcard, __pyx_n_s_fnmatchcase); if (unlikely(!__pyx_tuple__195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__195); + __Pyx_GIVEREF(__pyx_tuple__195); + __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wildcard_match, 842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + __pyx_tuple__197 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_version_info, __pyx_n_s_normalize); if (unlikely(!__pyx_tuple__197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__197); + __Pyx_GIVEREF(__pyx_tuple__197); + __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_unicode, 847, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + __pyx_tuple__199 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_string_text, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_sys, __pyx_n_s_unicodedata, __pyx_n_s_norm_text, __pyx_n_s_XUnicode_2, __pyx_n_s_XUnicode_3); if (unlikely(!__pyx_tuple__199)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__199); + __Pyx_GIVEREF(__pyx_tuple__199); + __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_init, 858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + __pyx_tuple__201 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_str, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + __pyx_tuple__203 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__203)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_repr, 893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + __pyx_tuple__205 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_the_attribute); if (unlikely(!__pyx_tuple__205)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getattr, 896, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + __pyx_tuple__207 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_string); if (unlikely(!__pyx_tuple__207)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__207); + __Pyx_GIVEREF(__pyx_tuple__207); + __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_cmp, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__209 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__209)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__209); + __Pyx_GIVEREF(__pyx_tuple__209); + __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 907, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__211)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__211); + __Pyx_GIVEREF(__pyx_tuple__211); + __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + __pyx_tuple__213 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_the_tuple, __pyx_n_s_attributes, __pyx_n_s_naked_type, __pyx_n_s_tup_obj, __pyx_n_s_key); if (unlikely(!__pyx_tuple__213)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_new, 926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_tuple__215 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__215)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_getAttributeDict, 938, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_tuple__217 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__217)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__217); + __Pyx_GIVEREF(__pyx_tuple__217); + __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_type, 945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC inittypes(void); /*proto*/ +PyMODINIT_FUNC inittypes(void) +#else +PyMODINIT_FUNC PyInit_types(void); /*proto*/ +PyMODINIT_FUNC PyInit_types(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_REFNANNY + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + #endif + __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_types(void)", 0); + if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __Pyx_CyFunction_USED + if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("types"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + if (__pyx_module_is_main_lib__Naked__toolshed__c__types) { + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.types")) { + if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.types", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + } + #endif + /*--- Builtin init code ---*/ + if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Global init code ---*/ + /*--- Variable export code ---*/ + /*--- Function export code ---*/ + /*--- Type init code ---*/ + /*--- Type import code ---*/ + /*--- Variable import code ---*/ + /*--- Function import code ---*/ + /*--- Execution code ---*/ + + /* "lib/Naked/toolshed/c/types.pyx":5 + * # cython: profile=False + * + * import sys # <<<<<<<<<<<<<< + * from Naked.settings import debug as DEBUG_FLAG + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":6 + * + * import sys + * from Naked.settings import debug as DEBUG_FLAG # <<<<<<<<<<<<<< + * + * #------------------------------------------------------------------------------ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_debug); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_debug); + __Pyx_GIVEREF(__pyx_n_s_debug); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_Naked_settings, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEBUG_FLAG, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":15 + * # Attribute accessors: hasattr, getattr, setattr, delattr + * #------------------------------------------------------------------------------ + * class NakedObject(object): # <<<<<<<<<<<<<< + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_builtin_object); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); + __Pyx_GIVEREF(__pyx_builtin_object); + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_NakedObject, __pyx_n_s_NakedObject, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":17 + * class NakedObject(object): + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): # <<<<<<<<<<<<<< + * if len(attributes) > 0: + * for key in attributes: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_1__init__, 0, __pyx_n_s_NakedObject___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_11NakedObject_16__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":27 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_3_getAttributeDict, 0, __pyx_n_s_NakedObject__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":34 + * # returns boolean for type of instance == type of test parameter instance + * #------------------------------------------------------------------------------ + * def _equal_type(self, other_obj): # <<<<<<<<<<<<<< + * return type(self) == type(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_5_equal_type, 0, __pyx_n_s_NakedObject__equal_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equal_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":41 + * # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + * #------------------------------------------------------------------------------ + * def _equal_attributes(self, other_obj): # <<<<<<<<<<<<<< + * return self.__dict__ == other_obj.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_7_equal_attributes, 0, __pyx_n_s_NakedObject__equal_attributes, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equal_attributes, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":47 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_9__eq__, 0, __pyx_n_s_NakedObject___eq, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":53 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_11__ne__, 0, __pyx_n_s_NakedObject___ne, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":65 + * # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * return self._equal_type(other_obj) and self._equal_attributes(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_13equals, 0, __pyx_n_s_NakedObject_equals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":72 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_11NakedObject_15type, 0, __pyx_n_s_NakedObject_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":15 + * # Attribute accessors: hasattr, getattr, setattr, delattr + * #------------------------------------------------------------------------------ + * class NakedObject(object): # <<<<<<<<<<<<<< + * # initialize with an attributes dictionary {attribute_name: attribute_value} + * def __init__(self, attributes={}, naked_type='NakedObject'): + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NakedObject, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NakedObject, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":82 + * # An inherited extension to the dictionary type + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyDict_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyDict_Type)))); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_XDict, __pyx_n_s_XDict, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":83 + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): # <<<<<<<<<<<<<< + * dict.__init__(self, dict_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_1__init__, 0, __pyx_n_s_XDict___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XDict_40__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":96 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __add__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_3__add__, 0, __pyx_n_s_XDict___add, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":115 + * # returns the updated XDict object + * #------------------------------------------------------------------------------ + * def __iadd__(self, other_dict): # <<<<<<<<<<<<<< + * try: + * self.update(other_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_5__iadd__, 0, __pyx_n_s_XDict___iadd, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_iadd, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":132 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_7__eq__, 0, __pyx_n_s_XDict___eq, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":138 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_9__ne__, 0, __pyx_n_s_XDict___ne, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":149 + * # tests for equality of the XDict (type, attributes, dictionary equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if dict(self) == dict(other_obj): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_11equals, 0, __pyx_n_s_XDict_equals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":167 + * # Test: test_xdict_conditional_map + * #------------------------------------------------------------------------------ + * def conditional_map_to_vals(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for key, value in self.xitems(): + * if conditional_function(key): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_13conditional_map_to_vals, 0, __pyx_n_s_XDict_conditional_map_to_vals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_conditional_map_to_vals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":178 + * # Test: test_xdict_map_to_vals + * #------------------------------------------------------------------------------ + * def map_to_vals(self, mapped_function): # <<<<<<<<<<<<<< + * # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + * for key, value in self.xitems(): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_15map_to_vals, 0, __pyx_n_s_XDict_map_to_vals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_map_to_vals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":189 + * # Test: test_xdict_val_xlist + * #------------------------------------------------------------------------------ + * def val_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.values(), self._getAttributeDict()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_17val_xlist, 0, __pyx_n_s_XDict_val_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_val_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":196 + * # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + * #------------------------------------------------------------------------------ + * def max_val(self): # <<<<<<<<<<<<<< + * return max(zip(self.values(), self.keys())) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_19max_val, 0, __pyx_n_s_XDict_max_val, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_max_val, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":202 + * # [ min_val method ] (tuple of minimum value and associated key) + * #------------------------------------------------------------------------------ + * def min_val(self): # <<<<<<<<<<<<<< + * return min(zip(self.values(), self.keys())) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_21min_val, 0, __pyx_n_s_XDict_min_val, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_min_val, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":209 + * # returns sum of all values in the dictionary + * #------------------------------------------------------------------------------ + * def sum_vals(self): # <<<<<<<<<<<<<< + * return sum(self.values()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_23sum_vals, 0, __pyx_n_s_XDict_sum_vals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_sum_vals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":218 + * # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + * #------------------------------------------------------------------------------ + * def val_count(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_25val_count, 0, __pyx_n_s_XDict_val_count, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_val_count, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":231 + * # Test: test_xdict_val_count_ci + * #------------------------------------------------------------------------------ + * def val_count_ci(self, value_name): # <<<<<<<<<<<<<< + * count = 0 + * for test_value in self.values(): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_27val_count_ci, 0, __pyx_n_s_XDict_val_count_ci, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_val_count_ci, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":250 + * # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + * #------------------------------------------------------------------------------ + * def difference(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) - set(another_dict.keys()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_29difference, 0, __pyx_n_s_XDict_difference, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_difference, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":258 + * # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + * #------------------------------------------------------------------------------ + * def intersection(self, another_dict): # <<<<<<<<<<<<<< + * return set(self.keys()) & set(another_dict.keys()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_31intersection, 0, __pyx_n_s_XDict_intersection, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_intersection, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":266 + * # Test: test_xdict_key_xlist + * #------------------------------------------------------------------------------ + * def key_xlist(self): # <<<<<<<<<<<<<< + * return XList(self.keys(), self._getAttributeDict()) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_33key_xlist, 0, __pyx_n_s_XDict_key_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_key_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":274 + * # Test: test_xdict_key_random + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * from Naked.toolshed.python import py_major_version + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_35random, 0, __pyx_n_s_XDict_random, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":286 + * # Test: test_xdict_key_random_sample + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * random_key_list = random.sample(self.keys(), number_of_items) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_37random_sample, 0, __pyx_n_s_XDict_random_sample, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random_sample, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":300 + * # Test: test_xdict_xitems + * #------------------------------------------------------------------------------ + * def xitems(self): # <<<<<<<<<<<<<< + * from Naked.toolshed.python import py_major_version + * if py_major_version() > 2: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XDict_39xitems, 0, __pyx_n_s_XDict_xitems, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xitems, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":82 + * # An inherited extension to the dictionary type + * #------------------------------------------------------------------------------ + * class XDict(dict, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + * dict.__init__(self, dict_obj) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XDict, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":311 + * # An inherited extension to the list object that permits attachment of attributes + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyList_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XList, __pyx_n_s_XList, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":312 + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): + * def __init__(self, list_obj, attributes={}, naked_type='XList'): # <<<<<<<<<<<<<< + * list.__init__(self, list_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_1__init__, 0, __pyx_n_s_XList___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults2), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XList_56__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":324 + * # extends XList with one or more other lists (`*other_lists`) + * #------------------------------------------------------------------------------ + * def __add__(self, *other_lists): # <<<<<<<<<<<<<< + * try: + * for the_list in other_lists: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_3__add__, 0, __pyx_n_s_XList___add, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_add, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":345 + * # extends XList with one other list (`another_list`) + * #------------------------------------------------------------------------------ + * def __iadd__(self, another_list): # <<<<<<<<<<<<<< + * try: + * #add attributes if it is an XList + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_5__iadd__, 0, __pyx_n_s_XList___iadd, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_iadd, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":364 + * # == overload + * #------------------------------------------------------------------------------ + * def __eq__(self, other_obj): # <<<<<<<<<<<<<< + * return self.equals(other_obj) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_7__eq__, 0, __pyx_n_s_XList___eq, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_eq, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":370 + * # != overload + * #------------------------------------------------------------------------------ + * def __ne__(self, other_obj): # <<<<<<<<<<<<<< + * result = self.equals(other_obj) + * if result: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_9__ne__, 0, __pyx_n_s_XList___ne, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ne, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":381 + * # tests for equality of the XList (type, attributes, list equality) + * #------------------------------------------------------------------------------ + * def equals(self, other_obj): # <<<<<<<<<<<<<< + * if self._equal_type(other_obj) and self._equal_attributes(other_obj): + * if list(self) == list(other_obj): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_11equals, 0, __pyx_n_s_XList_equals, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_equals, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":402 + * # Pass separator character(s) as an argument to the method + * #------------------------------------------------------------------------------ + * def join(self, separator=""): # <<<<<<<<<<<<<< + * return separator.join(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_13join, 0, __pyx_n_s_XList_join, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__87); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_join, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":409 + * # Append a string to each list item string + * #------------------------------------------------------------------------------ + * def postfix(self, after): # <<<<<<<<<<<<<< + * return [ "".join([x, after]) for x in self ] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_15postfix, 0, __pyx_n_s_XList_postfix, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_postfix, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":416 + * # Prepend a string to each list item string + * #------------------------------------------------------------------------------ + * def prefix(self, before): # <<<<<<<<<<<<<< + * return [ "".join([before, x]) for x in self ] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_17prefix, 0, __pyx_n_s_XList_prefix, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_prefix, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":423 + * # Surround each list item string with a before and after string argument passed to the method + * #------------------------------------------------------------------------------ + * def surround(self, before, after=""): # <<<<<<<<<<<<<< + * if after == "": + * after = before + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_19surround, 0, __pyx_n_s_XList_surround, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__94); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_surround, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":434 + * # return maximum value from the list items + * #------------------------------------------------------------------------------ + * def max(self): # <<<<<<<<<<<<<< + * return max(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_21max, 0, __pyx_n_s_XList_max, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_max, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":441 + * # return minimum value from the list items + * #------------------------------------------------------------------------------ + * def min(self): # <<<<<<<<<<<<<< + * return min(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_23min, 0, __pyx_n_s_XList_min, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_min, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":448 + * # return the sum of all list items + * #------------------------------------------------------------------------------ + * def sum(self): # <<<<<<<<<<<<<< + * return sum(self) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_25sum, 0, __pyx_n_s_XList_sum, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_sum, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":458 + * # returns an integer count of number of duplicate values + * #------------------------------------------------------------------------------ + * def count_duplicates(self): # <<<<<<<<<<<<<< + * return len(self) - len(set(self)) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_27count_duplicates, 0, __pyx_n_s_XList_count_duplicates, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_count_duplicates, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":465 + * # returns a new XList with duplicates removed + * #------------------------------------------------------------------------------ + * def remove_duplicates(self): # <<<<<<<<<<<<<< + * return XList( set(self), self._getAttributeDict() ) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_29remove_duplicates, 0, __pyx_n_s_XList_remove_duplicates, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_remove_duplicates, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":472 + * # returns a set containing items in XList that are not contained in `another_list` + * #------------------------------------------------------------------------------ + * def difference(self, another_list): # <<<<<<<<<<<<<< + * return set(self) - set(another_list) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_31difference, 0, __pyx_n_s_XList_difference, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_difference, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":479 + * # returns a set containing items that are in both XList and `another_list` + * #------------------------------------------------------------------------------ + * def intersection(self, another_list): # <<<<<<<<<<<<<< + * return set(self) & set(another_list) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_33intersection, 0, __pyx_n_s_XList_intersection, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_intersection, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":489 + * # returns original XList with modification of each item based upon `mapped_function` + * #------------------------------------------------------------------------------ + * def map_to_items(self, mapped_function): # <<<<<<<<<<<<<< + * # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + * for index, item in enumerate(self): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_35map_to_items, 0, __pyx_n_s_XList_map_to_items, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_map_to_items, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":500 + * # `conditional_function` with change performed as defined in `mapped_function` + * #------------------------------------------------------------------------------ + * def conditional_map_to_items(self, conditional_function, mapped_function): # <<<<<<<<<<<<<< + * for index, item in enumerate(self): + * if conditional_function(item): + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_37conditional_map_to_items, 0, __pyx_n_s_XList_conditional_map_to_items, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_conditional_map_to_items, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":513 + * # returns an integer count of the number of case-insensitive items that match `test_string` + * #------------------------------------------------------------------------------ + * def count_ci(self, test_string): # <<<<<<<<<<<<<< + * count = 0 + * for item in self: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_39count_ci, 0, __pyx_n_s_XList_count_ci, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_count_ci, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":527 + * # returns a single item list with a random element from the original XList + * #------------------------------------------------------------------------------ + * def random(self): # <<<<<<<<<<<<<< + * import random + * return random.choice(self) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_41random, 0, __pyx_n_s_XList_random, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":536 + * # number of items determined by the `number_of_items` argument + * #------------------------------------------------------------------------------ + * def random_sample(self, number_of_items): # <<<<<<<<<<<<<< + * import random + * return random.sample(self, number_of_items) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_43random_sample, 0, __pyx_n_s_XList_random_sample, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_random_sample, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":544 + * # randomly shuffle the contents of the list + * #------------------------------------------------------------------------------ + * def shuffle(self): # <<<<<<<<<<<<<< + * import random + * random.shuffle(self) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_45shuffle, 0, __pyx_n_s_XList_shuffle, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_shuffle, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":556 + * # returns a list of items that match the `wildcard` argument + * #------------------------------------------------------------------------------ + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_47wildcard_match, 0, __pyx_n_s_XList_wildcard_match, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_wildcard_match, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":568 + * # returns a list of items that match one or more | separated wildcards passed as string + * #------------------------------------------------------------------------------ + * def multi_wildcard_match(self, wildcards): # <<<<<<<<<<<<<< + * if hasattr(self, 'nkd_fnmatchcase'): + * fnmatchcase = self.nkd_fnmatchcase + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_49multi_wildcard_match, 0, __pyx_n_s_XList_multi_wildcard_match, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_multi_wildcard_match, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":589 + * # return an XSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(set(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_51xset, 0, __pyx_n_s_XList_xset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":597 + * # return an XFSet with unique XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(set(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_53xfset, 0, __pyx_n_s_XList_xfset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xfset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":605 + * # returns an XTuple with XList item values and XList attributes + * #------------------------------------------------------------------------------ + * def xtuple(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XTuple(tuple(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XList_55xtuple, 0, __pyx_n_s_XList_xtuple, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_xtuple, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":311 + * # An inherited extension to the list object that permits attachment of attributes + * #------------------------------------------------------------------------------ + * class XList(list, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, list_obj, attributes={}, naked_type='XList'): + * list.__init__(self, list_obj) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XList, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XList, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":613 + * # max heap queue + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop # <<<<<<<<<<<<<< + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappush); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush); + __Pyx_GIVEREF(__pyx_n_s_heappush); + __Pyx_INCREF(__pyx_n_s_heappop); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_heappop); + __Pyx_GIVEREF(__pyx_n_s_heappop); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappush, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":614 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XMaxHeap, __pyx_n_s_XMaxHeap, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":615 + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMaxHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_1__init__, 0, __pyx_n_s_XMaxHeap___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults3), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_12__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":621 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_3__len__, 0, __pyx_n_s_XMaxHeap___len, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_len, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":625 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_5push, 0, __pyx_n_s_XMaxHeap_push, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_push, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":630 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_7pop, 0, __pyx_n_s_XMaxHeap_pop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":637 + * + * # push new object and return the highest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (-priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_9pushpop, 0, __pyx_n_s_XMaxHeap_pushpop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pushpop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":646 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMaxHeap_11length, 0, __pyx_n_s_XMaxHeap_length, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":614 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMaxHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMaxHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XMaxHeap, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMaxHeap, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":653 + * # min heap queue + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop # <<<<<<<<<<<<<< + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappush); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush); + __Pyx_GIVEREF(__pyx_n_s_heappush); + __Pyx_INCREF(__pyx_n_s_heappop); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_heappop); + __Pyx_GIVEREF(__pyx_n_s_heappop); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappush, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":654 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XMinHeap, __pyx_n_s_XMinHeap, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "lib/Naked/toolshed/c/types.pyx":655 + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): + * def __init__(self, attributes={}, naked_type='XMinHeap'): # <<<<<<<<<<<<<< + * NakedObject.__init__(self, attributes, naked_type) + * self._queue = [] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_1__init__, 0, __pyx_n_s_XMinHeap___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults4), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_12__defaults__); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":662 + * + * # length of the queue + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_3__len__, 0, __pyx_n_s_XMinHeap___len, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_len, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":666 + * + * # O(log n) complexity + * def push(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_5push, 0, __pyx_n_s_XMinHeap_push, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_push, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":671 + * + * # O(log n) complexity + * def pop(self): # <<<<<<<<<<<<<< + * if self._queue: + * return heappop(self._queue)[-1] + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_7pop, 0, __pyx_n_s_XMinHeap_pop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":678 + * + * # push new object and return the lowest priority object + * def pushpop(self, the_object, priority): # <<<<<<<<<<<<<< + * heappush(self._queue, (priority, self._index, the_object)) + * self._index += 1 + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_9pushpop, 0, __pyx_n_s_XMinHeap_pushpop, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_pushpop, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":687 + * + * # the length of the queue + * def length(self): # <<<<<<<<<<<<<< + * return len(self._queue) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XMinHeap_11length, 0, __pyx_n_s_XMinHeap_length, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_length, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":654 + * #------------------------------------------------------------------------------ + * from heapq import heappush, heappop + * class XMinHeap(NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, attributes={}, naked_type='XMinHeap'): + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XMinHeap, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMinHeap, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":695 + * # + * #------------------------------------------------------------------------------ + * from collections import deque # <<<<<<<<<<<<<< + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_deque); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_deque); + __Pyx_GIVEREF(__pyx_n_s_deque); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_deque); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_deque, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":696 + * #------------------------------------------------------------------------------ + * from collections import deque + * class XQueue(deque, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_deque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_XQueue, __pyx_n_s_XQueue, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":697 + * from collections import deque + * class XQueue(deque, NakedObject): + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): # <<<<<<<<<<<<<< + * deque.__init__(self, initial_iterable, max_length) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XQueue_1__init__, 0, __pyx_n_s_XQueue___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults5), 2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_initial_iterable = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XQueue_2__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":696 + * #------------------------------------------------------------------------------ + * from collections import deque + * class XQueue(deque, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + * deque.__init__(self, initial_iterable, max_length) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XQueue, __pyx_t_3, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XQueue, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":707 + * # Inherits from set and from NakedObject (see methods in NakedObject at top of this module + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NakedObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PySet_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PySet_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PySet_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XSet, __pyx_n_s_XSet, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":708 + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): # <<<<<<<<<<<<<< + * set.__init__(self, set_obj) + * NakedObject.__init__(self, attributes, naked_type) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_1__init__, 0, __pyx_n_s_XSet___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults6), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_4XSet_10__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":713 + * + * # << operator is overloaded to extend the XSet with a second set + * def __lshift__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_3__lshift__, 0, __pyx_n_s_XSet___lshift, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_lshift, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":718 + * + * # += operator overload to extend the XSet with a second set + * def __iadd__(self, another_set): # <<<<<<<<<<<<<< + * self.update(another_set) + * return self + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_5__iadd__, 0, __pyx_n_s_XSet___iadd, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_iadd, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":722 + * return self + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_7xlist, 0, __pyx_n_s_XSet_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":726 + * return XList(list(self), attr_dict) + * + * def xfset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XFSet(self, attr_dict) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_4XSet_9xfset, 0, __pyx_n_s_XSet_xfset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xfset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":707 + * # Inherits from set and from NakedObject (see methods in NakedObject at top of this module + * #------------------------------------------------------------------------------ + * class XSet(set, NakedObject): # <<<<<<<<<<<<<< + * def __init__(self, set_obj, attributes={}, naked_type='XSet'): + * set.__init__(self, set_obj) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XSet, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSet, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":735 + * # Immutable so there is no setter method, attributes must be set in the constructor + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): # <<<<<<<<<<<<<< + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFrozenSet_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyFrozenSet_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFrozenSet_Type)))); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XFSet, __pyx_n_s_XFSet, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":736 + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): # <<<<<<<<<<<<<< + * set_obj = frozenset.__new__(cls, the_set) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XFSet___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults7), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_5XFSet_10__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":744 + * return set_obj + * + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_3_getAttributeDict, 0, __pyx_n_s_XFSet__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":747 + * return self.__dict__ + * + * def xlist(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XList(list(self), attr_dict, naked_type="XList") + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_5xlist, 0, __pyx_n_s_XFSet_xlist, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xlist, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":751 + * return XList(list(self), attr_dict, naked_type="XList") + * + * def xset(self): # <<<<<<<<<<<<<< + * attr_dict = self._getAttributeDict() + * return XSet(self, attr_dict, naked_type="XSet") + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_7xset, 0, __pyx_n_s_XFSet_xset, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xset, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":759 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_5XFSet_9type, 0, __pyx_n_s_XFSet_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":735 + * # Immutable so there is no setter method, attributes must be set in the constructor + * #------------------------------------------------------------------------------ + * class XFSet(frozenset): # <<<<<<<<<<<<<< + * def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + * set_obj = frozenset.__new__(cls, the_set) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XFSet, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XFSet, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":773 + * # Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method + * #------------------------------------------------------------------------------ + * class XString(str): # <<<<<<<<<<<<<< + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type)))); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XString, __pyx_n_s_XString, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":774 + * #------------------------------------------------------------------------------ + * class XString(str): + * def __new__(cls, string_text, attributes={}, naked_type='XString'): # <<<<<<<<<<<<<< + * str_obj = str.__new__(cls, string_text) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XString___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults8), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_7XString_22__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":786 + * # returns a dictionary of the XString instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_3_getAttributeDict, 0, __pyx_n_s_XString__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":793 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_5type, 0, __pyx_n_s_XString_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":800 + * + * ## TODO: see where + vs. join breakpoint becomes important + * def concat(self, *strings): # <<<<<<<<<<<<<< + * str_list = [] + * for x in strings: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_7concat, 0, __pyx_n_s_XString_concat, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_concat, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":807 + * + * # fastest substring search truth test + * def contains(self, substring): # <<<<<<<<<<<<<< + * return substring in self + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_9contains, 0, __pyx_n_s_XString_contains, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_contains, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":812 + * # split the string on one or more delimiters, return list + * # if up to two chars, then uses str.split(), if more chars then use re.split + * def xsplit(self, split_delimiter): # <<<<<<<<<<<<<< + * length = len(split_delimiter) + * if length > 2: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_11xsplit, 0, __pyx_n_s_XString_xsplit, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xsplit, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":830 + * + * # split the string on one or more characters and return items in set + * def xsplit_set(self, split_delimiter): # <<<<<<<<<<<<<< + * return set(self.xsplit(split_delimiter)) + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_13xsplit_set, 0, __pyx_n_s_XString_xsplit_set, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_xsplit_set, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":834 + * + * # str begins with substring - faster than str.startswith() + * def begins(self, begin_string): # <<<<<<<<<<<<<< + * return begin_string in self[0:len(begin_string)] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_15begins, 0, __pyx_n_s_XString_begins, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_begins, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":838 + * + * # str ends with substring - faster than str.endswith() + * def ends(self, end_string): # <<<<<<<<<<<<<< + * return end_string in self[-len(end_string):] + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_17ends, 0, __pyx_n_s_XString_ends, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_ends, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":842 + * + * # case sensitive wildcard match on the XString (boolean returned) + * def wildcard_match(self, wildcard): # <<<<<<<<<<<<<< + * from fnmatch import fnmatchcase + * return fnmatchcase(self, wildcard) + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_19wildcard_match, 0, __pyx_n_s_XString_wildcard_match, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_wildcard_match, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":847 + * + * # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + * def unicode(self): # <<<<<<<<<<<<<< + * from sys import version_info + * from unicodedata import normalize + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_7XString_21unicode, 0, __pyx_n_s_XString_unicode, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_unicode, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":773 + * # Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method + * #------------------------------------------------------------------------------ + * class XString(str): # <<<<<<<<<<<<<< + * def __new__(cls, string_text, attributes={}, naked_type='XString'): + * str_obj = str.__new__(cls, string_text) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XString, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XString, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":857 + * + * # this version works + * class XUnicode: # <<<<<<<<<<<<<< + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys + */ + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_XUnicode, __pyx_n_s_XUnicode, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "lib/Naked/toolshed/c/types.pyx":858 + * # this version works + * class XUnicode: + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): # <<<<<<<<<<<<<< + * import sys + * import unicodedata + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_1__init__, 0, __pyx_n_s_XUnicode___init, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_3)->__pyx_arg_attributes = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_8XUnicode_14__defaults__); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":889 + * self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + * + * def __str__(self): # <<<<<<<<<<<<<< + * # return self.naked_u_string + * return self.obj + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_3__str__, 0, __pyx_n_s_XUnicode___str, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_str, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":893 + * return self.obj + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.naked_u_string + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_5__repr__, 0, __pyx_n_s_XUnicode___repr, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_repr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":896 + * return self.naked_u_string + * + * def __getattr__(self, the_attribute): # <<<<<<<<<<<<<< + * return self.obj.__dict__[the_attribute] + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_7__getattr__, 0, __pyx_n_s_XUnicode___getattr, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":899 + * return self.obj.__dict__[the_attribute] + * + * def __cmp__(self, other_string): # <<<<<<<<<<<<<< + * return hash(self.naked_u_string) == hash(other_string) + * # TODO: add check for same attributes + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_9__cmp__, 0, __pyx_n_s_XUnicode___cmp, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":907 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_11_getAttributeDict, 0, __pyx_n_s_XUnicode__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_getAttributeDict, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":914 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_8XUnicode_13type, 0, __pyx_n_s_XUnicode_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":857 + * + * # this version works + * class XUnicode: # <<<<<<<<<<<<<< + * def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + * import sys + */ + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_XUnicode, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XUnicode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":925 + * # + * #------------------------------------------------------------------------------ + * class XTuple(tuple): # <<<<<<<<<<<<<< + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyTuple_Type)))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyTuple_Type)))); + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_XTuple, __pyx_n_s_XTuple, (PyObject *) NULL, __pyx_n_s_lib_Naked_toolshed_c_types, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "lib/Naked/toolshed/c/types.pyx":926 + * #------------------------------------------------------------------------------ + * class XTuple(tuple): + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): # <<<<<<<<<<<<<< + * tup_obj = tuple.__new__(cls, the_tuple) + * if len(attributes) > 0: + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_XTuple___new, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults10), 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_4)->__pyx_arg_attributes = __pyx_t_5; + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_3lib_5Naked_8toolshed_1c_5types_6XTuple_6__defaults__); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_new, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":938 + * # returns a dictionary of the NakedObject instance attributes + * #------------------------------------------------------------------------------ + * def _getAttributeDict(self): # <<<<<<<<<<<<<< + * return self.__dict__ + * + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_3_getAttributeDict, 0, __pyx_n_s_XTuple__getAttributeDict, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getAttributeDict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":945 + * # returns the Naked type extension string that is set in the constructor for each object type + * #------------------------------------------------------------------------------ + * def type(self): # <<<<<<<<<<<<<< + * if hasattr(self, '_naked_type_'): + * return self._naked_type_ + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_5types_6XTuple_5type, 0, __pyx_n_s_XTuple_type, NULL, __pyx_n_s_lib_Naked_toolshed_c_types, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_type, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":925 + * # + * #------------------------------------------------------------------------------ + * class XTuple(tuple): # <<<<<<<<<<<<<< + * def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + * tup_obj = tuple.__new__(cls, the_tuple) + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_XTuple, __pyx_t_2, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_XTuple, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "lib/Naked/toolshed/c/types.pyx":952 + * + * + * if __name__ == '__main__': # <<<<<<<<<<<<<< + * pass + * # no = nobj({"version":"1.0.1", "test":"code"}) + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + goto __pyx_L2; + } + __pyx_L2:; + + /* "lib/Naked/toolshed/c/types.pyx":1 + * #!/usr/bin/env python # <<<<<<<<<<<<<< + * # encoding: utf-8 + * # cython: profile=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + if (__pyx_m) { + __Pyx_AddTraceback("init lib.Naked.toolshed.c.types", __pyx_clineno, __pyx_lineno, __pyx_filename); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.types"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif /* CYTHON_REFNANNY */ + +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; +#endif + result = (*call)(func, arg, kw); +#if PY_VERSION_HEX >= 0x02060000 + Py_LeaveRecursiveCall(); +#endif + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if CYTHON_COMPILING_IN_CPYTHON + result = PyDict_GetItem(__pyx_d, name); + if (result) { + Py_INCREF(result); + } else { +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_COMPILING_IN_CPYTHON +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + #if CYTHON_PEP393_ENABLED + if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) + return -1; + #endif + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, length * kind); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +#else + PyErr_GetExcInfo(type, value, tb); +#endif +} +static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(type, value, tb); +#endif +} + +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_COMPILING_IN_CPYTHON + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_Restore(type, value, tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(type, value, tb); +#endif +} + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + #if PY_VERSION_HEX < 0x02050000 + if (PyClass_Check(type)) { + #else + if (PyType_Check(type)) { + #endif +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else /* Python 3+ */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + if (PyObject_IsSubclass(instance_class, type)) { + type = instance_class; + } else { + instance_class = NULL; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +#else + if (cause && cause != Py_None) { +#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck) { +#if CYTHON_COMPILING_IN_CPYTHON + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + return NULL; + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL) +} +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_COMPILING_IN_CPYTHON + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) + PyErr_Clear(); + else + goto bad; + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_COMPILING_IN_CPYTHON + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) + value = Py_None; /* Mark as deleted */ + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) { +#else + if (unlikely(value == NULL || !PyString_Check(value))) { +#endif + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + Py_DECREF(res); + return 0; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ +#define PY_WRITE_RESTRICTED WRITE_RESTRICTED +#endif +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + op->func_weakreflist = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyMem_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + if (m->func_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return PyMethod_New(func, + type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +#if CYTHON_COMPILING_IN_PYPY +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + Py_ssize_t size; + switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { + case METH_VARARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 0) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL) || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size == 1) + return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%zd given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +#else +static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return PyCFunction_Call(func, arg, kw); +} +#endif +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ + sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ +#if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ +#else + 0, /*reserved*/ +#endif + (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __Pyx_CyFunction_Call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ + 0, /*tp_doc*/ + (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ + (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ + offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_CyFunction_methods, /*tp_methods*/ + __pyx_CyFunction_members, /*tp_members*/ + __pyx_CyFunction_getsets, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + __Pyx_CyFunction_descr_get, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ +#if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ +#endif +#if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ +#endif +}; +static int __Pyx_CyFunction_init(void) { +#if !CYTHON_COMPILING_IN_PYPY + __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; +#endif + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (__pyx_CyFunctionType == NULL) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyMem_Malloc(size); + if (!m->defaults) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + #if PY_VERSION_HEX >= 0x02050000 + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(1); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; /* try absolute import on failure */ + } + #endif + if (!module) { + #if PY_VERSION_HEX < 0x03030000 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } + #else + if (level>0) { + PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); + goto bad; + } + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); + #endif +bad: + #if PY_VERSION_HEX < 0x03030000 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(long) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ + { \ + func_type value = func(x); \ + if (sizeof(target_type) < sizeof(func_type)) { \ + if (unlikely(value != (func_type) (target_type) value)) { \ + func_type zero = 0; \ + PyErr_SetString(PyExc_OverflowError, \ + (is_unsigned && unlikely(value < zero)) ? \ + "can't convert negative value to " #target_type : \ + "value too large to convert to " #target_type); \ + return (target_type) -1; \ + } \ + } \ + return (target_type) value; \ + } + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +} + +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; + } + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(int) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(int)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) + } else if (sizeof(int) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +} + +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + #if PY_VERSION_HEX < 0x02050000 + return PyErr_Warn(NULL, message); + #else + return PyErr_WarnEx(NULL, message, 1); + #endif + } + return 0; +} + +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = (start + end) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, /*int argcount,*/ + 0, /*int kwonlyargcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, /*int firstlineno,*/ + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_globals = 0; + PyFrameObject *py_frame = 0; + py_code = __pyx_find_code_object(c_line ? c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? c_line : py_line, py_code); + } + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + py_frame = PyFrame_New( + PyThreadState_GET(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = py_line; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else /* Python 3+ has unicode identifiers */ + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { +#if PY_VERSION_HEX < 0x03030000 + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +#else /* PY_VERSION_HEX < 0x03030000 */ + if (PyUnicode_READY(o) == -1) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (PyUnicode_IS_ASCII(o)) { + *length = PyUnicode_GET_DATA_SIZE(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ + return PyUnicode_AsUTF8AndSize(o, length); +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ +#endif /* PY_VERSION_HEX < 0x03030000 */ + } else +#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ +#if !CYTHON_COMPILING_IN_PYPY +#if PY_VERSION_HEX >= 0x02060000 + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { + PyNumberMethods *m; + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (PyInt_Check(x) || PyLong_Check(x)) +#else + if (PyLong_Check(x)) +#endif + return Py_INCREF(x), x; + m = Py_TYPE(x)->tp_as_number; +#if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = PyNumber_Long(x); + } +#else + if (m && m->nb_int) { + name = "int"; + res = PyNumber_Long(x); + } +#endif + if (res) { +#if PY_MAJOR_VERSION < 3 + if (!PyInt_Check(res) && !PyLong_Check(res)) { +#else + if (!PyLong_Check(res)) { +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + name, name, Py_TYPE(res)->tp_name); + Py_DECREF(res); + return NULL; + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) + return PyInt_AS_LONG(b); +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + switch (Py_SIZE(b)) { + case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; + case 0: return 0; + case 1: return ((PyLongObject*)b)->ob_digit[0]; + } + #endif + #endif + #if PY_VERSION_HEX < 0x02060000 + return PyInt_AsSsize_t(b); + #else + return PyLong_AsSsize_t(b); + #endif + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +#if PY_VERSION_HEX < 0x02050000 + if (ival <= LONG_MAX) + return PyInt_FromLong((long)ival); + else { + unsigned char *bytes = (unsigned char *) &ival; + int one = 1; int little = (int)*(unsigned char*)&one; + return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); + } +#else + return PyInt_FromSize_t(ival); +#endif +} + + +#endif /* Py_PYTHON_H */ diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.pyx b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.pyx new file mode 100644 index 00000000..49840acf --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/c/types.pyx @@ -0,0 +1,999 @@ +#!/usr/bin/env python +# encoding: utf-8 +# cython: profile=False + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [[ NakedObject class ]] +# A generic Python object +# Assigns object attributes by key name in the dictionary argument to the constructor +# The methods are inherited by other mutable Naked object extension types +# Attribute accessors: hasattr, getattr, setattr, delattr +#------------------------------------------------------------------------------ +class NakedObject(object): + # initialize with an attributes dictionary {attribute_name: attribute_value} + def __init__(self, attributes={}, naked_type='NakedObject'): + if len(attributes) > 0: + for key in attributes: + setattr(self, key, attributes[key]) + setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ _equal_type method ] (boolean) + # returns boolean for type of instance == type of test parameter instance + #------------------------------------------------------------------------------ + def _equal_type(self, other_obj): + return type(self) == type(other_obj) + + #------------------------------------------------------------------------------ + # [ _equal_attributes metod ] (method) + # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + #------------------------------------------------------------------------------ + def _equal_attributes(self, other_obj): + return self.__dict__ == other_obj.__dict__ + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # equality testing based on type and attributes + # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + #------------------------------------------------------------------------------ + def equals(self, other_obj): + return self._equal_type(other_obj) and self._equal_attributes(other_obj) + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + +#------------------------------------------------------------------------------ +# [[ XDict class ]] +# An inherited extension to the dictionary type +#------------------------------------------------------------------------------ +class XDict(dict, NakedObject): + def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + dict.__init__(self, dict_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XDict Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + overload + # overwrites existing keys with key:value pairs from new dictionaries if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __add__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # +- overload + # overwrites existing keys with another_dict (right sided argument) keys if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __iadd__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XDict (type, attributes, dictionary equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if dict(self) == dict(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XDict Value Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ conditional_map_to_vals method ] (XDict) + # returns the original XDict with values that meet True condition in `conditional_function` + # modified as per the `mapped_function` with single value argument call + # Test: test_xdict_conditional_map + #------------------------------------------------------------------------------ + def conditional_map_to_vals(self, conditional_function, mapped_function): + for key, value in self.xitems(): + if conditional_function(key): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ map_to_vals method ] (XDict) + # returns the original XDict with all values modified as per the `mapped_function` + # Test: test_xdict_map_to_vals + #------------------------------------------------------------------------------ + def map_to_vals(self, mapped_function): + # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + for key, value in self.xitems(): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ val_xlist method ] (XList) + # return an XList of the values in the XDict + # Test: test_xdict_val_xlist + #------------------------------------------------------------------------------ + def val_xlist(self): + return XList(self.values(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ max_val method ] (tuple of maximum value and associated key) + # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + #------------------------------------------------------------------------------ + def max_val(self): + return max(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ min_val method ] (tuple of minimum value and associated key) + #------------------------------------------------------------------------------ + def min_val(self): + return min(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ sum_vals method ] (numeric return type dependent upon original value type) + # returns sum of all values in the dictionary + #------------------------------------------------------------------------------ + def sum_vals(self): + return sum(self.values()) + + #------------------------------------------------------------------------------ + # [ val_count method ] (integer) + # returns an integer value for the total count of `value_name` in the dictionary values + # Case sensitive test if comparing strings + # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + #------------------------------------------------------------------------------ + def val_count(self, value_name): + count = 0 + for test_value in self.values(): + if value_name == test_value: + count += 1 + return count + + #------------------------------------------------------------------------------ + # [ value_count_ci method ] (integer) + # returns an integer value for the total count of case insensitive `value_name` + # strings/char in the dictionary values. Can include non-string types (ignores them) + # Test: test_xdict_val_count_ci + #------------------------------------------------------------------------------ + def val_count_ci(self, value_name): + count = 0 + for test_value in self.values(): + try: + if value_name.lower() in test_value.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + + #------------------------------------------------------------------------------ + # XDict Key Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ difference method ] (difference set of keys) + # definition: keys that are included in self, but not in `another_dict` + # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + #------------------------------------------------------------------------------ + def difference(self, another_dict): + return set(self.keys()) - set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ intersection method ] (intersection set of keys) + # definition: keys that are included in both self and `another_dict` + # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + #------------------------------------------------------------------------------ + def intersection(self, another_dict): + return set(self.keys()) & set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ key_xlist method ] (XList) + # returns an XList of the keys in the XDict + # Test: test_xdict_key_xlist + #------------------------------------------------------------------------------ + def key_xlist(self): + return XList(self.keys(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ random method ] (dictionary) + # return new Python dictionary with single, random key:value pair + # Test: test_xdict_key_random + #------------------------------------------------------------------------------ + def random(self): + import random + from Naked.toolshed.python import py_major_version + random_key_list = random.sample(self.keys(), 1) + the_key = random_key_list[0] + return {the_key: self[the_key]} + + #------------------------------------------------------------------------------ + # [ random_sample method ] (dictionary) + # return new Python dictionary with `number_of_items` random key:value pairs + # Test: test_xdict_key_random_sample + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + random_key_list = random.sample(self.keys(), number_of_items) + new_dict = {} + for item in random_key_list: + new_dict[item] = self[item] + return new_dict + + #------------------------------------------------------------------------------ + # [ xitems method ] (tuple) + # Generator method that returns tuples of every key, value in dictionary + # uses appropriate method from Python 2 and 3 interpreters + # Test: test_xdict_xitems + #------------------------------------------------------------------------------ + def xitems(self): + from Naked.toolshed.python import py_major_version + if py_major_version() > 2: + return self.items() + else: + return self.iteritems() + +#------------------------------------------------------------------------------ +# [[ XList class ]] +# An inherited extension to the list object that permits attachment of attributes +#------------------------------------------------------------------------------ +class XList(list, NakedObject): + def __init__(self, list_obj, attributes={}, naked_type='XList'): + list.__init__(self, list_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XList Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + operator overload + # extends XList with one or more other lists (`*other_lists`) + #------------------------------------------------------------------------------ + def __add__(self, *other_lists): + try: + for the_list in other_lists: + # add attributes if it is an XList + if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(the_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # += overload + # extends XList with one other list (`another_list`) + #------------------------------------------------------------------------------ + def __iadd__(self, another_list): + try: + #add attributes if it is an XList + if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(another_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XList (type, attributes, list equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if list(self) == list(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XList Methods + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # XList String Methods + #------------------------------------------------------------------------------ + # [ join method ] (string) + # Concatenate strings in the list and return + # Default separator between string list values is an empty string + # Pass separator character(s) as an argument to the method + #------------------------------------------------------------------------------ + def join(self, separator=""): + return separator.join(self) + + #------------------------------------------------------------------------------ + # [ postfix method ] (list of strings) + # Append a string to each list item string + #------------------------------------------------------------------------------ + def postfix(self, after): + return [ "".join([x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # [ prefix method ] (list of strings) + # Prepend a string to each list item string + #------------------------------------------------------------------------------ + def prefix(self, before): + return [ "".join([before, x]) for x in self ] + + #------------------------------------------------------------------------------ + # [ surround method ] (list of strings) + # Surround each list item string with a before and after string argument passed to the method + #------------------------------------------------------------------------------ + def surround(self, before, after=""): + if after == "": + after = before + return [ "".join([before, x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # XList Numeric Methods + #------------------------------------------------------------------------------ + # [ max method ] (list dependent type, single value) + # return maximum value from the list items + #------------------------------------------------------------------------------ + def max(self): + return max(self) + + #------------------------------------------------------------------------------ + # [ min method ] (list dependent type, single value) + # return minimum value from the list items + #------------------------------------------------------------------------------ + def min(self): + return min(self) + + #------------------------------------------------------------------------------ + # [ sum method ] (list dependent type, single value) + # return the sum of all list items + #------------------------------------------------------------------------------ + def sum(self): + return sum(self) + + #------------------------------------------------------------------------------ + # XList Data Management Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_duplicates method ] (integer) + # returns an integer count of number of duplicate values + #------------------------------------------------------------------------------ + def count_duplicates(self): + return len(self) - len(set(self)) + + #------------------------------------------------------------------------------ + # [ remove_duplicates ] (XList) + # returns a new XList with duplicates removed + #------------------------------------------------------------------------------ + def remove_duplicates(self): + return XList( set(self), self._getAttributeDict() ) + + #------------------------------------------------------------------------------ + # [ difference method ] (set) + # returns a set containing items in XList that are not contained in `another_list` + #------------------------------------------------------------------------------ + def difference(self, another_list): + return set(self) - set(another_list) + + #------------------------------------------------------------------------------ + # [ intersection method ] (set) + # returns a set containing items that are in both XList and `another_list` + #------------------------------------------------------------------------------ + def intersection(self, another_list): + return set(self) & set(another_list) + + #------------------------------------------------------------------------------ + # XList Function Mapping Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ map_to_items method ] (XList) + # returns original XList with modification of each item based upon `mapped_function` + #------------------------------------------------------------------------------ + def map_to_items(self, mapped_function): + # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + for index, item in enumerate(self): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # [ conditional_map_to_items method ] (XList) + # returns original XList with modification of items that meet True condition in + # `conditional_function` with change performed as defined in `mapped_function` + #------------------------------------------------------------------------------ + def conditional_map_to_items(self, conditional_function, mapped_function): + for index, item in enumerate(self): + if conditional_function(item): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # XList Descriptive Stats Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_ci method ] (integer) + # returns an integer count of the number of case-insensitive items that match `test_string` + #------------------------------------------------------------------------------ + def count_ci(self, test_string): + count = 0 + for item in self: + try: + if test_string.lower() in item.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + #------------------------------------------------------------------------------ + # [ random method ] (list) + # returns a single item list with a random element from the original XList + #------------------------------------------------------------------------------ + def random(self): + import random + return random.choice(self) + + #------------------------------------------------------------------------------ + # [ random_sample method ] (list) + # returns a list with one or more random items from the original XList + # number of items determined by the `number_of_items` argument + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + return random.sample(self, number_of_items) + + #------------------------------------------------------------------------------ + # [ shuffle method ] (XList) + # randomly shuffle the contents of the list + #------------------------------------------------------------------------------ + def shuffle(self): + import random + random.shuffle(self) + return self + + #------------------------------------------------------------------------------ + # XList Match Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ wildcard_match method ] (list) + # returns a list of items that match the `wildcard` argument + #------------------------------------------------------------------------------ + def wildcard_match(self, wildcard): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + return [ x for x in self if fnmatchcase(x, wildcard) ] + + #------------------------------------------------------------------------------ + # [ multi_wildcard_match method ] (list) + # returns a list of items that match one or more | separated wildcards passed as string + #------------------------------------------------------------------------------ + def multi_wildcard_match(self, wildcards): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + wc_list = wildcards.split('|') + return_list = [] + for wc in wc_list: + temp_list = [ x for x in self if fnmatchcase(x, wc) ] + for result in temp_list: + return_list.append(result) + return return_list + + #------------------------------------------------------------------------------ + # XList Cast Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ xset method ] (XSet) + # return an XSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xfset method ] (XFSet) + # return an XFSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xtuple method ] (XTuple) + # returns an XTuple with XList item values and XList attributes + #------------------------------------------------------------------------------ + def xtuple(self): + attr_dict = self._getAttributeDict() + return XTuple(tuple(self), attr_dict) + +#------------------------------------------------------------------------------ +# [[ XMaxHeap class ]] +# max heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMaxHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMaxHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None + + # push new object and return the highest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + +#------------------------------------------------------------------------------ +# [[ XMinHeap class ]] +# min heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMinHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMinHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # push new object and return the lowest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None #return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + + +#------------------------------------------------------------------------------ +# [[ XQueue class ]] +# +#------------------------------------------------------------------------------ +from collections import deque +class XQueue(deque, NakedObject): + def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + deque.__init__(self, initial_iterable, max_length) + NakedObject.__init__(self, attributes, naked_type) + + +#------------------------------------------------------------------------------ +# [[ XSet class ]] +# An inherited extension to the mutable set object that permits attribute assignment +# Inherits from set and from NakedObject (see methods in NakedObject at top of this module +#------------------------------------------------------------------------------ +class XSet(set, NakedObject): + def __init__(self, set_obj, attributes={}, naked_type='XSet'): + set.__init__(self, set_obj) + NakedObject.__init__(self, attributes, naked_type) + + # << operator is overloaded to extend the XSet with a second set + def __lshift__(self, another_set): + self.update(another_set) + return self + + # += operator overload to extend the XSet with a second set + def __iadd__(self, another_set): + self.update(another_set) + return self + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict) + + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(self, attr_dict) + +#------------------------------------------------------------------------------ +# [[ XFSet class ]] +# An inherited extension to the immutable frozenset object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +#------------------------------------------------------------------------------ +class XFSet(frozenset): + def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + set_obj = frozenset.__new__(cls, the_set) + if len(attributes) > 0: + for key in attributes: + setattr(set_obj, key, attributes[key]) + setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + return set_obj + + def _getAttributeDict(self): + return self.__dict__ + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict, naked_type="XList") + + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(self, attr_dict, naked_type="XSet") + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XString class ]] +# An inherited extension to the immutable string object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +# Python 2: byte string by default, can cast to normalized UTF-8 with XString().unicode() method +# Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method +#------------------------------------------------------------------------------ +class XString(str): + def __new__(cls, string_text, attributes={}, naked_type='XString'): + str_obj = str.__new__(cls, string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) + return str_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the XString instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + ## TODO: see where + vs. join breakpoint becomes important + def concat(self, *strings): + str_list = [] + for x in strings: + str_list.append(x) + return "".join(str_list) + + # fastest substring search truth test + def contains(self, substring): + return substring in self + + # split the string on one or more delimiters, return list + # if up to two chars, then uses str.split(), if more chars then use re.split + def xsplit(self, split_delimiter): + length = len(split_delimiter) + if length > 2: + import re + split_delimiter = "".join([ '[', split_delimiter, ']' ]) + return re.split(split_delimiter, self) + elif length > 1: + delim2 = split_delimiter[1] + first_list = self.split(split_delimiter[0]) + result_list = [] + for item in first_list: + for subitem in item.split(delim2): + result_list.append(subitem) + return result_list + else: + return self.split(split_delimiter) + + # split the string on one or more characters and return items in set + def xsplit_set(self, split_delimiter): + return set(self.xsplit(split_delimiter)) + + # str begins with substring - faster than str.startswith() + def begins(self, begin_string): + return begin_string in self[0:len(begin_string)] + + # str ends with substring - faster than str.endswith() + def ends(self, end_string): + return end_string in self[-len(end_string):] + + # case sensitive wildcard match on the XString (boolean returned) + def wildcard_match(self, wildcard): + from fnmatch import fnmatchcase + return fnmatchcase(self, wildcard) + + # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + def unicode(self): + from sys import version_info + from unicodedata import normalize + if version_info[0] == 2: + return normalize('NFKD', self.decode('UTF-8')) + else: + return normalize('NFKD', self) + + +# this version works +class XUnicode: + def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + import sys + import unicodedata + norm_text = unicodedata.normalize('NFKD', string_text) + + class XUnicode_2(unicode): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + str_obj = unicode.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + return str_obj + + class XUnicode_3(str): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + str_obj = str.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + return str_obj + + + if sys.version_info[0] == 2: + self.obj = XUnicode_2(norm_text, attributes) + self.norm_unicode = norm_text + self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + elif sys.version_info[0] == 3: + self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + + def __str__(self): + # return self.naked_u_string + return self.obj + + def __repr__(self): + return self.naked_u_string + + def __getattr__(self, the_attribute): + return self.obj.__dict__[the_attribute] + + def __cmp__(self, other_string): + return hash(self.naked_u_string) == hash(other_string) + # TODO: add check for same attributes + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XTuple class ]] +# +#------------------------------------------------------------------------------ +class XTuple(tuple): + def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + tup_obj = tuple.__new__(cls, the_tuple) + if len(attributes) > 0: + for key in attributes: + setattr(tup_obj, key, attributes[key]) + setattr(tup_obj, '_naked_type_', naked_type) + return tup_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +if __name__ == '__main__': + pass + # no = nobj({"version":"1.0.1", "test":"code"}) + # print(no) + # print(no.version) + # print(no.test) + # nl = XList([1, 2, 3, 1, 2, 5], {"version":"1.0.1", "test":"code"}) + # print(nl.count_duplicates()) + # the_list = list(range(5000)) + # nl = XList(the_list) + # nq = XPriorityQueue() + # nq.push('test', 5) + # nq.push('one', 3) + # nq.push('another', 4) + # print(nq.pop()) + # print(nq.pop()) + # print(nq.pop()) + + # nl = XList([2, 2, 2, 'another'], {'p': 'attribute'}) + # print(nl) + # print(nl.count_item(2)) + # nq = XQueue(nl, max_length=2) + # print(nq) + + # xs = XSet({'test', 'true', 'false'}, {'bonus': 'candy', 'test': 'another'}) + # xs += {'bogus', 'yep'} + # print(xs) + + # xd = XDict({'test2': 0, 'is': 1}, {'a': '1', 'b': '2'}) + # ad = {'test': 0, 'is': 2} + # ld = xd.intersection(ad) + # print(ld) + # xd = xd + ad + ld + # print(xd.map_to_vals(pr)) + # print(xd.a) + # print(xd) + # print(xd.a) + # print(xd.min_val()) + # print(xd.conditional_map_to_vals(matcher, resulter)) + + # nl = XList([ 'test.txt', 'bogus.txt', 'test.py', 'another.rb', 'est.doc', 'est.py' ]) + # print(nl.multi_wildcard_match('*.py|*.txt|*.doc')) + + # xstr = XString("Hey! Cœur It's Bengali ব য,\nand here is some more ২") + # ustr = xstr.unicode() + # print(isinstance(ustr, bytes)) + # print(xstr) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/casts.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/casts.py new file mode 100644 index 00000000..32e84319 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/casts.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +# encoding: utf-8 +# tests in test_CASTS.py + +from Naked.toolshed.types import NakedObject, XFSet, XDict, XList, XQueue, XSet, XString, XTuple +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ nobj ] (NakedObject) +# Cast a dictionary of attributes to a NakedObject with key>attribute mapping +#------------------------------------------------------------------------------ +def nobj(attributes={}): + try: + return NakedObject(attributes) + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to create a NakedObject with the requested argument using the nobj() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xd function ] (XDict) +# Cast a Python dictionary to a XDict +#------------------------------------------------------------------------------ +def xd(dictionary_arg, attributes={}): + try: + return XDict(dictionary_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XDict with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XDict with the xd() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xl function ] (XList) +# Cast a Python list, set, or tuple to a XList +#------------------------------------------------------------------------------ +def xl(list_arg, attributes={}): + try: + return XList(list_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XList with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XList with the xl() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xq function ] (XQueue) +# Cast a Python list, set, tuple to a XQueue +#------------------------------------------------------------------------------ +def xq(queue_arg, attributes={}): + try: + return XQueue(queue_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XQueue with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XQueue with the xq() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xset function ] (XSet) +# Cast a Python set to a XSet +#------------------------------------------------------------------------------ +def xset(set_arg, attributes={}): + try: + return XSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xfset function ] (XFSet) +# Cast a Python set to a XFSet +#------------------------------------------------------------------------------ +def xfset(set_arg, attributes={}): + try: + return XFSet(set_arg, attributes) + except TypeError: + raise TypeError("Attempted to cast to a XSet with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XSet with the xset() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xstr function ] (XString) +# Cast a Python string to a XString +#------------------------------------------------------------------------------ +def xstr(string_arg, attributes={}): + try: + return XString(string_arg, attributes) + except TypeError as te: + raise TypeError("Attempted to cast to a XString with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XString with the xstr() function (Naked.toolshed.casts.py).") + raise e + +#------------------------------------------------------------------------------ +# [ xt function ] (XTuple) +# Cast a Python list, set, tuple to a XTuple +#------------------------------------------------------------------------------ +def xt(tup_arg, attributes={}): + try: + return XTuple(tup_arg, attributes) + except TypeError as te: + raise TypeError("Attempted to cast to a XTuple with an incompatible type") + except Exception as e: + if DEBUG_FLAG: + print("Naked Framework Error: unable to cast object to a XTuple with the xt() function (Naked.toolshed.casts.py).") + raise e + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/file.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/file.py new file mode 100644 index 00000000..e9304adb --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/file.py @@ -0,0 +1,376 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ IO class ] +# interface for all local file IO classes +#------------------------------------------------------------------------------ +class IO: + def __init__(self,filepath): + self.filepath = filepath + +#------------------------------------------------------------------------------ +# [ FileWriter class ] +# writes data to local files +#------------------------------------------------------------------------------ +class FileWriter(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ append method ] + # Universal text file writer that appends to existing file using system default text encoding or utf-8 if throws unicode error + # Tests: test_IO.py:: test_file_ascii_readwrite_append, test_file_append_missingfile + #------------------------------------------------------------------------------ + def append(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): #confirm that file exists, if not raise IOError (assuming that developer expected existing file if using append) + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append).") + with open(self.filepath, 'a') as appender: + appender.write(text) + except UnicodeEncodeError as ue: + self.append_utf8(text) #try writing as utf-8 + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ append_utf8 method ] + # Text writer that appends text to existing file with utf-8 encoding + # Tests: test_IO.py :: test_file_utf8_readwrite_append + #------------------------------------------------------------------------------ + def append_utf8(self, text): + try: + from Naked.toolshed.system import file_exists + if not file_exists(self.filepath): + raise IOError("The file specified for the text append does not exist (Naked.toolshed.file.py:append_utf8).") + import codecs + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + with codecs.open(self.filepath, mode='a', encoding="utf_8") as appender: + appender.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to append text to the file with the append_utf8 method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ gzip method (writer) ] + # writes data to gzip compressed file + # Note: adds .gz extension to filename if user did not specify it in the FileWriter class constructor + # Note: uses compresslevel = 6 as default to balance speed and compression level (which in general is not significantly less than 9) + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_gzip_utf8_readwrite_explicit_decode + #------------------------------------------------------------------------------ + def gzip(self, text, compression_level=6): + try: + import gzip + if not self.filepath.endswith(".gz"): + self.filepath = self.filepath + ".gz" + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(text) + except UnicodeEncodeError as ue: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + import codecs + binary_data = codecs.encode(norm_text, "utf_8") + with gzip.open(self.filepath, 'wb', compresslevel=compression_level) as gzip_writer: + gzip_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to gzip compress the file with the gzip method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write method ] + # Universal text file writer that writes by system default or utf-8 encoded unicode if throws UnicdeEncodeError + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_ascii_readwrite_missing_file, + # test_file_utf8_write_raises_unicodeerror + #------------------------------------------------------------------------------ + def write(self, text): + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + except UnicodeEncodeError as ue: + self.write_utf8(text) # attempt to write with utf-8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the write() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_as method ] + # text file writer that uses developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas + #------------------------------------------------------------------------------ + def write_as(self, text, the_encoding=""): + try: + if the_encoding == "": #if the developer did not include the encoding type, raise an exception + raise RuntimeError("The text encoding was not specified as an argument to the write_as() method (Naked.toolshed.file.py:write_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='w') as f: + f.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to write file with the specified encoding using the write_as() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ write_bin method ] + # binary data file writer + # Tests: test_IO.py :: test_file_bin_readwrite + #------------------------------------------------------------------------------ + def write_bin(self, binary_data): + try: + with open(self.filepath, 'wb') as bin_writer: + bin_writer.write(binary_data) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write binary data to file with the write_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ safe_write method ] (boolean) + # Universal text file writer (writes in default encoding unless throws unicode error) that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + # Tests: test_IO.py :: test_file_ascii_safewrite, test_file_utf8_safewrite + #------------------------------------------------------------------------------ + def safe_write(self, text): + import os.path + if not os.path.exists(self.filepath): # if the file does not exist, then can write + try: + with open(self.filepath, 'wt') as writer: + writer.write(text) + return True + except UnicodeEncodeError as ue: + self.write_utf8(text) + return True + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write() method (Naked.toolshed.file.py).") + raise e + else: + return False # if file exists, do not write and return False + + #------------------------------------------------------------------------------ + # [ safe_write_bin method ] + # Binary data file writer that will NOT overwrite existing file at the requested filepath + # returns boolean indicator for success of write based upon test for existence of file (False = write failed because file exists) + #------------------------------------------------------------------------------ + def safe_write_bin(self, file_data): + try: + import os.path + if not os.path.exists(self.filepath): + with open(self.filepath, 'wb') as writer: + writer.write(file_data) + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write to requested file with the safe_write_bin() method (Naked.toolshed.file.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ write_utf8 method ] + # Text file writer with explicit UTF-8 text encoding + # uses filepath from class constructor + # requires text to passed as a method parameter + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_raises_unicodeerror + #------------------------------------------------------------------------------ + def write_utf8(self, text): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='w') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for write with the write_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + import unicodedata + norm_text = unicodedata.normalize('NFKD', text) # NKFD normalization of the unicode data before write + f.write(norm_text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to write UTF-8 encoded text to file with the write_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + +#------------------------------------------------------------------------------ +# [ FileReader class ] +# reads data from local files +# filename assigned in constructor (inherited from IO class interface) +#------------------------------------------------------------------------------ +class FileReader(IO): + def __init__(self, filepath): + IO.__init__(self, filepath) + + #------------------------------------------------------------------------------ + # [ read method ] (string) + # Universal text file reader that will read utf-8 encoded unicode or non-unicode text as utf-8 + # returns string or unicode (py3 = string for unicode and non-unicode, py2 = str for non-unicode, unicode for unicode) + # Tests: test_IO.py :: test_file_ascii_readwrite, test_file_read_missing_file, + #------------------------------------------------------------------------------ + def read(self): + try: + return self.read_utf8() #reads everything as unicode in utf8 encoding + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the read() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_bin method ] (binary byte string) + # Universal binary data file reader + # returns file contents in binary mode as binary byte strings + # Tests: test_IO.py :: test_file_bin_readwrite, test_file_read_bin_missing_file + #------------------------------------------------------------------------------ + def read_bin(self): + try: + with open(self.filepath, 'rb') as bin_reader: + data = bin_reader.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the binary data from the file with the read_bin method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_as method ] (string with developer specified text encoding) + # Text file reader with developer specified text encoding + # returns file contents in developer specified text encoding + # Tests: test_IO.py :: test_file_utf8_readas_writeas, test_file_readas_missing_file + #------------------------------------------------------------------------------ + def read_as(self, the_encoding): + try: + if the_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the read_as method (Naked.toolshed.file.py:read_as).") + import codecs + with codecs.open(self.filepath, encoding=the_encoding, mode='r') as f: + data = f.read() + return data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with the developer specified text encoding with the read_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines method ] (list of strings) + # Read text from file line by line, uses utf8 encoding by default + # returns list of utf8 encoded file lines as strings + # Tests: test_IO.py :: test_file_readlines, test_file_readlines_missing_file + #------------------------------------------------------------------------------ + def readlines(self): + try: + return self.readlines_utf8() # read as utf8 encoded file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read text from the requested file with the readlines() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_as method ] (list of developer specified encoded strings) + # Read lines from file with developer specified text encoding + # Returns a list of developer specified encoded lines from the file + # Tests: test_IO.py :: + #------------------------------------------------------------------------------ + def readlines_as(self, dev_spec_encoding): + try: + if dev_spec_encoding == "": + raise RuntimeError("The text file encoding was not specified as an argument to the readlines_as method (Naked.toolshed.file.py:readlines_as).") + import codecs + with codecs.open(self.filepath, encoding=dev_spec_encoding, mode='r') as reader: + data_list = [] + for line in reader: + data_list.append(line) + return data_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the specified encoding with the readlines_as method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ readlines_utf8 method ] (list of utf-8 encoded strings) + # Read text from unicode file by line + # Returns list of file unicode text lines as unicode strings + # Tests: test_IO.py :: test_file_readlines_unicode, test_file_readlines_utf8_missing_file + #------------------------------------------------------------------------------ + def readlines_utf8(self): + try: + import codecs + with codecs.open(self.filepath, encoding='utf-8', mode='r') as uni_reader: + modified_text_list = [] + for line in uni_reader: + import unicodedata + norm_line = unicodedata.normalize('NFKD', line) # NKFD normalization of the unicode data before use + modified_text_list.append(norm_line) + return modified_text_list + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to read lines in the unicode file with the readlines_utf8 method (Naked.toolshed.file.py)") + raise e + + #------------------------------------------------------------------------------ + # [ read_gzip ] (byte string) + # reads data from a gzip compressed file + # returns the decompressed binary data from the file + # Note: if decompressing unicode file, set encoding="utf-8" + # Tests: test_IO.py :: test_file_gzip_ascii_readwrite, test_file_gzip_utf8_readwrite, + # test_file_read_gzip_missing_file + #------------------------------------------------------------------------------ + def read_gzip(self, encoding="system_default"): + try: + import gzip + with gzip.open(self.filepath, 'rb') as gzip_reader: + file_data = gzip_reader.read() + if encoding in ["utf-8", "utf8", "utf_8", "UTF-8", "UTF8", "UTF_8"]: + import codecs + file_data = codecs.decode(file_data, "utf-8") + import unicodedata + norm_data = unicodedata.normalize('NFKD', file_data) # NKFD normalization of the unicode data before passing back to the caller + return norm_data + else: + return file_data + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read from the gzip compressed file with the read_gzip() method (Naked.toolshed.file.py).") + raise e + + #------------------------------------------------------------------------------ + # [ read_utf8 method ] (string) + # read data from a file with explicit UTF-8 encoding + # uses filepath from class constructor + # returns a unicode string containing the file data (unicode in py2, str in py3) + # Tests: test_IO.py :: test_file_utf8_readwrite, test_file_utf8_readwrite_append, + # test_file_read_utf8_missing_file + #------------------------------------------------------------------------------ + def read_utf8(self): + try: + import codecs + f = codecs.open(self.filepath, encoding='utf_8', mode='r') + except IOError as ioe: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to open file for read with read_utf8() method (Naked.toolshed.file.py).") + raise ioe + try: + textstring = f.read() + import unicodedata + norm_text = unicodedata.normalize('NFKD', textstring) # NKFD normalization of the unicode data before returns + return norm_text + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to read the file with UTF-8 encoding using the read_utf8() method (Naked.toolshed.file.py).") + raise e + finally: + f.close() + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/git.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/git.py new file mode 100644 index 00000000..591cd472 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/git.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# encoding: utf-8 + + + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/ink.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/ink.py new file mode 100644 index 00000000..e3dba038 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/ink.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# encoding: utf-8 + +#------------------------------------------------------------------------------ +# The Ink Templating System +# A lightweight, fast, flexible text templating system +# Copyright 2014 Christopher Simpkins +# MIT License +#------------------------------------------------------------------------------ +import re + +#------------------------------------------------------------------------------ +# Template class +# A template string class that is inherited from Python str +# Includes metadata about the template: +# odel = opening delimiter +# cdel = closing delimiter +# varlist = inclusive list of all variables in the template text (parsed in constructor) +# Delimiters: +# default = {{variable}} +# assign new opening and closing delimiters as parameters when you make a new Template instance +# `escape_regex` boolean is a speedup, avoids Python escape of special regex chars if you do not need it +#------------------------------------------------------------------------------ +class Template(str): + def __new__(cls, template_text, open_delimiter="{{", close_delimiter="}}", escape_regex=False): + obj = str.__new__(cls, template_text) + obj.odel = open_delimiter + obj.cdel = close_delimiter + obj.varlist = obj._make_var_list(template_text, escape_regex) #contains all unique parsed variables from the template in a list + return obj + + #------------------------------------------------------------------------------ + # [ _make_var_list method ] (list of strings) + # Private method that parses the template string for all variables that match the delimiter pattern + # Returns a list of the variable names as strings + #------------------------------------------------------------------------------ + def _make_var_list(self, template_text, escape_regex=False): + if escape_regex: + open_match_pat = self._escape_regex_special_chars(self.odel) + close_match_pat = self._escape_regex_special_chars(self.cdel) + match_pat = open_match_pat + r'(.*?)' + close_match_pat # capture group contains the variable name used between the opening and closing delimiters + else: + match_pat = self.odel + r'(.*?)' + self.cdel + var_list = re.findall(match_pat, template_text) #generate a list that contains the capture group from the matches (i.e. the variables in the template) + return set(var_list) # remove duplicate entries by converting to set (and lookup speed improvement from hashing) + + #------------------------------------------------------------------------------ + # [ _escape_regex_special_chars method ] (string) + # Private method that escapes special regex metacharacters + # Returns a string with the escaped character modifications + #------------------------------------------------------------------------------ + def _escape_regex_special_chars(self, test_escape_string): + return re.escape(test_escape_string) + +#------------------------------------------------------------------------------ +# Renderer class +# Render the variable replacements in the ink template using a Python dictionary key argument +# Construct the instace of the Renderer with the Ink template and the dictionary key +# Run the renderer with the render method on the instance (e.g. r.render()) +# Parameters to constructor: +# - template = an Ink Template instance +# - key = a dictionary mapped key = variable name : value = variable replacement data +# - html_entities = encode html entities with HTML escaped characters (default = False = do not encode) +#------------------------------------------------------------------------------ + +class Renderer: + def __init__(self, template, key, html_entities=False): + self.odel = template.odel + self.cdel = template.cdel + self.template = template + self.html_entities = html_entities + self.key_dict = key + + #------------------------------------------------------------------------------ + # [ render method ] (string) + # renders the variable replacements in the Ink template + # returns the rendered template as a string + #------------------------------------------------------------------------------ + def render(self): + # make local variables for the loop below (faster) + local_dict = self.key_dict + local_template = self.template + local_varlist = self.template.varlist + local_odel = self.odel + local_cdel = self.cdel + local_htmlent = self.html_entities + if local_htmlent: + from xml.sax.saxutils import escape #from Python std lib + for key in local_dict: + if key in local_varlist: + value = local_dict[key] + replace_string = local_odel + key + local_cdel + if local_htmlent: + value = escape(value) #xml.sax.saxutils function + local_template = local_template.replace(replace_string, value) + return local_template + + ##TODO : multiple file render method? + + +if __name__ == '__main__': + pass + # template = Template("This is a of the {{test}} of the {{document}} {{type}} and more of the {{test}} {{document}} {{type}}") + # renderer = Renderer(template, {'test': 'ব য', 'document':'testing document', 'type':'of mine', 'bogus': 'bogus test'}) + # print(renderer.render()) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/iter.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/iter.py new file mode 100644 index 00000000..652e721e --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/iter.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import itertools + +#------------------------------------------------------------------------------ +# [ chain_iter method ] (iterable items of type contained in multiple list arguments) +# Generator that returns iterable for each item in the multiple list arguments in sequence +#------------------------------------------------------------------------------ +def chain_iter(self, *lists): + return itertools.chain(*lists) + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/network.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/network.py new file mode 100644 index 00000000..335e8c1b --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/network.py @@ -0,0 +1,351 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import requests +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +#[ HTTP class] +# handle HTTP requests +# Uses the requests external library to handle HTTP requests and response object (available on PyPI) +#------------------------------------------------------------------------------ +class HTTP(): + def __init__(self, url="", request_timeout=10): + self.url = url + self.request_timeout = request_timeout + #------------------------------------------------------------------------------ + # HTTP response properties (assignment occurs with the HTTP request methods) + #------------------------------------------------------------------------------ + self.res = None # assigned with the requests external library response object after a HTTP method call + + #------------------------------------------------------------------------------ + # [ get method ] (string) - + # HTTP GET request - returns text string + # returns data stream read from the URL (string) + # Default timeout = 10 s from class constructor + # Re-throws ConnectionError on failed connection (e.g. no site at URL) + # Test : test_NETWORK.py :: test_http_get, test_http_get_response_change, + # test_http_post_reponse_change, test_http_get_response_check + #------------------------------------------------------------------------------ + def get(self, follow_redirects=True): + try: + response = requests.get(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_data method ] (binary data) + # HTTP GET request, return binary data + # returns data stream with raw binary data + #------------------------------------------------------------------------------ + def get_bin(self): + try: + response = requests.get(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance + return response.content # return binary data instead of text (get() returns text) + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request with the URL " + self.url + " using the get_data() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_bin_write_file method ] (boolean) + # open HTTP data stream with GET request, make file with the returned binary data + # file path is passed to the method by the developer + # set suppress_output to True if you want to suppress the d/l status information that is printed to the standard output stream + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_binary + #------------------------------------------------------------------------------ + def get_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_bin_write_file() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ get_txt_write_file method ] (boolean) + # open HTTP data stream with GET request, write file with utf-8 encoded text using returned text data + # file path is passed to the method by the developer (default is the base filename in the URL if not specified) + # return True on successful pull and write to disk + # Tests: test_NETWORK.py :: test_http_get_text + #------------------------------------------------------------------------------ + def get_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") + sys.stdout.flush() + response = requests.get(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: #write as text + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform GET request and write file with the URL " + self.url + " using the get_data_write_txt() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ head method ] (dictionary of strings) + # HTTP HEAD request + # returns a dictionary of the header strings + # test for a specific header on either the response dictionary or the instance res property + # Usage example: + # content_type = instance.res['content-type'] + # Tests: test_NETWORK.py :: test_http_head + #------------------------------------------------------------------------------ + def head(self): + try: + response = requests.head(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.headers + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform a HEAD request with the head() method (Naked.toolshed.network.py).") + raise e + + + #------------------------------------------------------------------------------ + # [ post method ] (string) + # HTTP POST request for text + # returns text from the URL as a string + #------------------------------------------------------------------------------ + def post(self, follow_redirects=True): + try: + response = requests.post(self.url, timeout=self.request_timeout, allow_redirects=follow_redirects) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.text + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform a POST request with the post() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin method ] (binary data) + # HTTP POST request for binary data + # returns binary data from the URL + #------------------------------------------------------------------------------ + def post_bin(self): + try: + response = requests.post(self.url, timeout=self.request_timeout) + self.res = response # assign the response object from requests to a property on the instance of HTTP class + return response.content + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.exit("Naked Framework Error: Unable to perform POST request with the post_bin() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_bin_write_file method ] (boolean = success of write) + # HTTP POST request, write binary file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_bin_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + with open(filepath, 'wb') as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ post_txt_write_file method ] (boolean = success of file write) + # HTTP POST request, write utf-8 encoded text file with the response data + # default filepath is the basename of the URL file, may be set by passing an argument to the method + # returns a boolean that indicates the success of the file write + #------------------------------------------------------------------------------ + def post_txt_write_file(self, filepath="", suppress_output = False, overwrite_existing = False): + try: + import os # used for os.fsync() method in the write + # Confirm that the file does not exist and prevent overwrite if it does (unless developer indicates otherwise) + if not overwrite_existing: + from Naked.toolshed.system import file_exists + if file_exists(filepath): + if not suppress_output: + print("Download aborted. A local file with the requested filename exists on the path.") + return False + if (filepath == "" and len(self.url) > 1): + filepath = self.url.split('/')[-1] # use the filename from URL and working directory as default if not specified + if not suppress_output: + sys.stdout.write("Downloading file from " + self.url + "...") #provide information about the download to user + sys.stdout.flush() + response = requests.post(self.url, timeout=self.request_timeout, stream=True) + self.res = response + import codecs + with codecs.open(filepath, mode='w', encoding="utf-8") as f: # write as binary data + for chunk in response.iter_content(chunk_size=2048): + chunk = chunk.decode('utf-8') + f.write(chunk) + f.flush() + os.fsync(f.fileno()) # flush all internal buffers to disk + if not suppress_output: + print(" ") + print("Download complete.") # provide user with completion information + return True # return True if successful write + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to perform POST request and write file with the URL " + self.url + " using the post_data_write_bin() method (Naked.toolshed.network.py)") + raise e + + #------------------------------------------------------------------------------ + # [ response method ] + # getter method for the requests library object that is assigned as a property + # on the HTTP class after a HTTP request method is run (e.g. get()) + # Note: must run one of the HTTP request verbs to assign this property before use of getter (=None by default) + # Tests: test_NETWORK.py :: test_http_get_response_check + #------------------------------------------------------------------------------ + def response(self): + try: + return self.res + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to return the response from your HTTP request with the response() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ get_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for GET request + # Note: this method runs its own GET request, does not need to be run separately + # Tests: test_NETWORK.py :: + #------------------------------------------------------------------------------ + def get_status_ok(self): + try: + self.get() #run the get request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the get_status_ok() method (Naked.toolshed.network.py).") + raise e + + #------------------------------------------------------------------------------ + # [ post_status_ok method ] (boolean) + # return boolean whether HTTP response was in 200 status code range for POST request + # Note: method runs its own post method, not necessary to run separately + #------------------------------------------------------------------------------ + def post_status_ok(self): + try: + self.post() #run the post request + if self.res and self.res.status_code: + return (self.res.status_code == requests.codes.ok) + else: + return False + except requests.exceptions.ConnectionError as ce: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Unable to obtain the HTTP status with the post_status_ok() method (Naked.toolshed.network.py).") + raise e + +if __name__ == '__main__': + pass + #------------------------------------------------------------------------------ + # HTTP GET 1 + #------------------------------------------------------------------------------ + # http = HTTP("http://www.google.com") + # data = http.get() + # print(data) + # from Naked.toolshed.file import FileWriter + # w = FileWriter("testfile.txt") + # w.write_utf8(data) + #------------------------------------------------------------------------------ + # HTTP GET 2 + #------------------------------------------------------------------------------ + # http = HTTP() + # http.url = "http://www.google.com" + # print(http.get()) + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/python.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/python.py new file mode 100644 index 00000000..68d6b4b3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/python.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# encoding: utf-8 +# tests: test_PYTHON.py + +from sys import version_info + +#------------------------------------------------------------------------------ +# Python Versions +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ py_version function ] (tuple of (major, minor, patch)) +#------------------------------------------------------------------------------ +def py_version(): + return (version_info[0], version_info[1], version_info[2]) + +#------------------------------------------------------------------------------ +# [ py_major_version function ] (integer) +# Return Python interpreter major version number +#------------------------------------------------------------------------------ +def py_major_version(): + return (version_info[0]) + +#------------------------------------------------------------------------------ +# [ py_minor_version function ] (integer) +# Return Python interpreter minor version number +#------------------------------------------------------------------------------ +def py_minor_version(): + return (version_info[1]) + +#------------------------------------------------------------------------------ +# [ py_patch_version function ] (integer) +# Return Python interpreter patch version number +#------------------------------------------------------------------------------ +def py_patch_version(): + return (version_info[2]) + +#------------------------------------------------------------------------------ +# [ is_py2 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 2 +#------------------------------------------------------------------------------ +def is_py2(): + return (version_info[0] == (2)) + +#------------------------------------------------------------------------------ +# [ is_py3 function ] (boolean) +# Return truth result for question is interpreter running a version of Python 3 +#------------------------------------------------------------------------------ +def is_py3(): + return (version_info[0] == (3)) + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/shell.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/shell.py new file mode 100644 index 00000000..4585d428 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/shell.py @@ -0,0 +1,263 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import os +import sys +import subprocess +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [ execute function ] (boolean) +# run a shell command and print std out / std err to terminal +# returns True if exit status = 0 +# returns False if exit status != 0 +#------------------------------------------------------------------------------ +def execute(command): + try: + response = subprocess.call(command, shell=True) + if response == 0: + return True + else: + return False + except subprocess.CalledProcessError as cpe: + try: + sys.stderr.write(cpe.output) + except TypeError as te: + sys.stderr.write(str(cpe.output)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the execute() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ run function ] (bytes string or False) +# run a shell command +# default = +# success:: print to std out and return the std out string +# error:: print to stderr return False, suppress SystemExit on error to permit ongoing run of calling script +# suppress_stdout = True >> suppress std output stream print (returns string) +# suppress_stderr = True >> suppress std err stream print (returns False) +# suppress_exit_status_call = False >> raise SystemExit with the returned status code +#------------------------------------------------------------------------------ +def run(command, suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + if not suppress_stdout: + print(response) + return response + except subprocess.CalledProcessError as cpe: + if not suppress_stderr: # error in existing application (non-zero exit status) + try: + sys.stderr.write(cpe.output) + except TypeError as te: # deal with unusual errors from some system executables that return non string type through subprocess.check_output + sys.stderr.write(str(cpe.output)) + if not suppress_exit_status_call: + if cpe.returncode: + sys.exit(cpe.returncode) + else: + sys.exit(1) + return False # return False on non-zero exit status codes (i.e. failures in the subprocess executable) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# [ muterun function ] (NakedObject with attributes for stdout, stderr, exitcode) +# run a shell command and return a response object +# return object attributes : stdout (bytes), stderr (bytes), exitcode (int) +#------------------------------------------------------------------------------ +def muterun(command): + try: + from Naked.toolshed.types import NakedObject + response_obj = NakedObject() + response = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + response_obj.stdout = response + response_obj.exitcode = 0 + response_obj.stderr = b"" + return response_obj + except subprocess.CalledProcessError as cpe: + response_obj.stdout = b"" + response_obj.stderr = cpe.output + if cpe.returncode: + response_obj.exitcode = cpe.returncode + else: + response_obj.exitcode = 1 + return response_obj + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the mute_run() function (Naked.toolshed.shell.py).") + raise e + + +#------------------------------------------------------------------------------ +# RUBY COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_rb function ] (boolean) +# execute a ruby script file in a shell subprocess +#------------------------------------------------------------------------------ +def execute_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return execute(rb_command) # return result of execute() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ run_rb function ] (bytes string or False) +# execute a ruby script file in a shell subprocess, return the output +#------------------------------------------------------------------------------ +def run_rb(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return run(rb_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_rb function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_rb(file_path, arguments=""): + try: + if len(arguments) > 0: + rb_command = 'ruby ' + file_path + " " + arguments + else: + rb_command = 'ruby ' + file_path + return muterun(rb_command) # return result of muterun() of the ruby file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_rb() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# NODE.JS COMMAND EXECUTION +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# [ execute_js function ] (boolean) +# execute a node.js script file in a shell subprocess +# stdout stream to terminal +# returns True for success (=0) exit status code +# returns False for unsuccessful (!=0) exit status code +#------------------------------------------------------------------------------ +def execute_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return execute(js_command) # return result of execute() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e +#------------------------------------------------------------------------------ +# [ run_js function ] (byte string or False) +# execute a node.js script file in a shell subprocess +# print the standard output to the standard output stream by default +# set suppress_output to True to suppress stream to standard output. String is still returned to calling function +# set suppress_exit_status_call to True to suppress raising sys.exit on failures with shell subprocess exit status code (if available) or 1 if not available +# returns the standard output byte string from the subprocess executable on success +# returns False if the subprocess exits with a non-zero exit code +#------------------------------------------------------------------------------ +def run_js(file_path, arguments="", suppress_stdout=False, suppress_stderr=False, suppress_exit_status_call=True): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return run(js_command, suppress_stdout, suppress_stderr, suppress_exit_status_call) # return result of run() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the run_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ muterun_js function ] (NakedObject response object) +#------------------------------------------------------------------------------ +def muterun_js(file_path, arguments=""): + try: + if len(arguments) > 0: + js_command = 'node ' + file_path + " " + arguments + else: + js_command = 'node ' + file_path + return muterun(js_command) # return result of muterun() of node.js file + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to run the shell command with the muterun_js() function (Naked.toolshed.shell.py).") + raise e + +#------------------------------------------------------------------------------ +# [ Environment Class ] +# shell environment variables class +# self.env = the environment variable dictionary +# self.vars = the environment variable names list +#------------------------------------------------------------------------------ +class Environment(): + def __init__(self): + self.env = os.environ + self.vars = list(os.environ.keys()) + + #------------------------------------------------------------------------------ + # [ is_var method ] (boolean) + # return boolean for presence of a variable name in the shell environment + #------------------------------------------------------------------------------ + def is_var(self, var_name): + try: + return (var_name in self.vars) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine if the variable is included in the shell variable list with the is_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_var method ] (string) + # get the variable value for a variable in the shell environment list + # returns empty string if the variable is not included in the environment variable list + #------------------------------------------------------------------------------ + def get_var(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name] + else: + return "" + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the requested shell variable with the get_var() method (Naked.toolshed.shell).") + raise e + + #------------------------------------------------------------------------------ + # [ get_split_var_list method ] (list of strings) + # return a list of strings split by OS dependent separator from the shell variable assigment string + # if the variable name is not in the environment list, returns an empty list + #------------------------------------------------------------------------------ + def get_split_var_list(self, var_name): + try: + if var_name in self.vars: + return self.env[var_name].split(os.pathsep) + else: + return [] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return environment variable list with the get_split_var_list() method (Naked.toolshed.shell).") + raise e + + +if __name__ == '__main__': + pass + # e = Environment() + # pathlist = e.get_split_var_list("PATH") + # for item in pathlist: + # print(item) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/state.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/state.py new file mode 100644 index 00000000..76c7fb8f --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/state.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# encoding: utf-8 + +from Naked.settings import debug as DEBUG_FLAG +from Naked.toolshed.system import cwd +import Naked.toolshed.python as py +import sys +import os +import datetime + +class StateObject: + def __init__(self): + now = datetime.datetime.now() + self.py2 = py.is_py2() #truth test Python 2 interpreter + self.py3 = py.is_py3() #truth test Python 3 interpreter + self.py_major = py.py_major_version() #Python major version + self.py_minor = py.py_minor_version() #Python minor version + self.py_patch = py.py_patch_version() #Python patch version + self.os = sys.platform #user operating system + self.cwd = cwd() #current (present) working directory + self.parent_dir = os.pardir + self.default_path = os.defpath + self.user_path = os.path.expanduser("~") + self.string_encoding = sys.getdefaultencoding() + self.file_encoding = sys.getfilesystemencoding() + self.hour = now.hour + self.min = now.minute + self.year = now.year + self.day = now.day + self.month = now.month + self.second = now.second + +if __name__ == '__main__': + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/system.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/system.py new file mode 100644 index 00000000..610a843e --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/system.py @@ -0,0 +1,553 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +import os +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY PATHS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filename function ] (string) +# returns file name from a file path (including the file extension) +# Tests: test_SYSTEM.py :: test_sys_filename +#------------------------------------------------------------------------------ +def filename(filepath): + try: + return os.path.basename(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return base filename from filename() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_extension function ] (string) +# returns file extension from a filepath +# Tests: test_SYSTEM.py :: test_sys_file_extension +#------------------------------------------------------------------------------ +def file_extension(filepath): + try: + return os.path.splitext(filepath)[1] + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file extension with file_extension() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ directory function ] (string) +# returns directory path to the filepath +# Tests: test_SYSTEM.py :: test_sys_dir_path +#------------------------------------------------------------------------------ +def directory(filepath): + try: + return os.path.dirname(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return directory path to file with directory() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ make_path function ] (string) +# returns OS independent file path from tuple of path components +# Tests: test_SYSTEM.py :: test_sys_make_filepath +#------------------------------------------------------------------------------ +def make_path(*path_list): + try: + return os.path.join(*path_list) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to make OS independent path with the make_path() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_to_basefile decorator function ] (returns decorated original function) +# concatenates the absolute working directory path to the basename of file in the first parameter of the undecorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_to_basefile +#------------------------------------------------------------------------------ +def currentdir_to_basefile(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(file_name, *args, **kwargs): + current_directory = os.getcwd() #get current working directory path + full_path = os.path.join(current_directory, file_name) # join cwd path to the filename for full path + return func(full_path, *args, **kwargs) #return the original function with the full path to file as first argument + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_to_basefile() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ currentdir_firstparam decorator function ] (returns decorated original function) +# adds the current working directory as the first function parameter of the decorated function +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_path_first_arg +#------------------------------------------------------------------------------ +def currentdir_firstparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(dir="", *args, **kwargs): + current_directory = os.getcwd() + return func(current_directory, *args, **kwargs) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_firstargument() decorator function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ currentdir_lastargument decorator function ] (returns decorated original function) +# adds the current working directory as the last function parameter of the decorated function +# Note: you cannot use other named arguments in the original function with this decorator +# Note: the current directory argument in the last position must be named current_dir +# Tests: test_SYSTEM.py :: test_sys_add_currentdir_last_arg +#------------------------------------------------------------------------------ +def currentdir_lastparam(func): + try: + from functools import wraps + + @wraps(func) + def wrapper(*args, **kwargs): + the_cwd = os.getcwd() + return func(*args, current_dir=the_cwd) + return wrapper + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with the currentdir_lastargument() decorator function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ fullpath function ] (string) +# returns the absolute path to a file that is in the current working directory +# file_name = the basename of the file in the current working directory +# Example usage where test.txt is in working directory: +# filepath = fullpath("test.txt") +# Tests: test_SYSTEM.py :: test_sys_full_path_to_file +#------------------------------------------------------------------------------ +@currentdir_to_basefile # current directory decorator - adds the directory path up to the filename to the basefile name argument to original function +def fullpath(file_name): + try: + return file_name + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return absolute path to the file with the fullpath() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ cwd function ] (string) +# returns the current working directory path +# does not need to be called with an argument, the decorator assigns it +# Example usage: +# current_dir = cwd() +# Tests: test_SYSTEM.py :: test_sys_cwd_path +#------------------------------------------------------------------------------ +@currentdir_firstparam +def cwd(dir=""): + try: + return dir + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return the current working directory with the cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DIRECTORY WRITES +# +#------------------------------------------------------------------------------ + +## TODO: add tests +#------------------------------------------------------------------------------ +# [ make_dirs function ] (--none--) +# make a new directory path (recursive if multiple levels of depth) if it +# DOES NOT already exist +#------------------------------------------------------------------------------ +def make_dirs(dirpath): + try: + import os + import errno + os.makedirs(dirpath) + return True + except OSError as ose: + if ose.errno != errno.EEXIST: # directory already exists + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: Could not write the directory path passed as an argument to the make_dirs() function (Naked.toolshed.system).") + raise ose + else: + return False + except Exception as e: + raise e + +#------------------------------------------------------------------------------ +# +# FILE & DIRECTORY TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ file_exists function ] (boolean) +# return boolean for existence of file in specified path +# Tests: test_SYSTEM.py :: test_file_exists +#------------------------------------------------------------------------------ +def file_exists(filepath): + try: + if os.path.exists(filepath) and os.path.isfile(filepath): # test that exists and is a file + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for the presence of the file with the file_exists() method (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_file function ] (boolean) +# returns boolean for determination of whether filepath is a file +# Tests: test_SYSTEM.py :: test_sys_is_file, test_sys_is_file_missing_file, +# test_sys_is_file_when_dir +#------------------------------------------------------------------------------ +def is_file(filepath): + try: + return os.path.isfile(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for file with the is_file() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ dir_exists function ] (boolean) +# return boolean for existence of directory in specified path +# Tests: test_SYSTEM.py :: test_dir_exists, test_dir_exists_missing_dir +#------------------------------------------------------------------------------ +def dir_exists(dirpath): + try: + if os.path.exists(dirpath) and os.path.isdir(dirpath): # test that exists and is a directory + return True + else: + return False + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the dir_exists() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ is_dir function ] (boolean) +# returns boolean for determination of whether dirpath is a directory +# Tests: test_SYSTEM.py :: test_sys_dir_is_dir, test_sys_dir_is_dir_when_file, +# test_sys_dir_is_dir_when_missing +#------------------------------------------------------------------------------ +def is_dir(dirpath): + try: + return os.path.isdir(dirpath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: error with test for directory with the is_dir() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE METADATA +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ filesize function ] (int) +# return file size in bytes +# Tests: test_SYSTEM.py :: test_sys_meta_file_size +#------------------------------------------------------------------------------ +def file_size(filepath): + try: + return os.path.getsize(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file size with the file_size() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ file_mod_time function ] (string) +# return the last file modification date/time +# Tests: test_SYSTEM.py :: test_sys_meta_file_mod +#------------------------------------------------------------------------------ +def file_mod_time(filepath): + try: + import time + return time.ctime(os.path.getmtime(filepath)) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return file modification data with the file_mod_time() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# FILE LISTINGS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ list_all_files function ] (list) +# returns a list of all files in developer specified directory +# Tests: test_SYSTEM.py :: test_sys_list_all_files, test_sys_list_all_files_emptydir +#------------------------------------------------------------------------------ +def list_all_files(dir): + try: + filenames = [name for name in os.listdir(dir) if os.path.isfile(os.path.join(dir, name))] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to generate directory file list with the list_all_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files function ] (list) +# returns a list of files filtered by developer defined file extension in developer defined directory +# Usage example: +# filenames = list_filter_files("py", "tests") +# Tests: test_SYSTEM.py :: test_sys_list_filter_files, test_sys_list_filter_files_nomatch +#------------------------------------------------------------------------------ +def list_filter_files(extension_filter, dir): + try: + if not extension_filter.startswith("."): + extension_filter = "." + extension_filter + filenames = [name for name in os.listdir(dir) if name.endswith(extension_filter)] + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files with the list_filter_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_all_files_cwd function ] (list) +# returns a list of all files in the current working directory +# Note: does not require argument, the decorator assigns the cwd +# Usage example: +# file_list = list_all_files_cwd() +# Tests: test_SYSTEM.py :: test_sys_list_all_files_cwd +#------------------------------------------------------------------------------ +@currentdir_firstparam +def list_all_files_cwd(dir=""): + try: + return list_all_files(dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of all files in current working directory with the list_all_files_cwd() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ list_filter_files_cwd function ] (list) +# returns a list of all files in the current working directory filtered by developer specified file extension +# Note: do not specify the second argument, decorator assigns it +# Usage example: +# file_list = list_filter_files_cwd(".py") +# Tests: test_SYSTEM.py :: test_sys_filter_files_cwd, test_sys_filter_files_cwd_nomatch +#------------------------------------------------------------------------------ +@currentdir_lastparam +def list_filter_files_cwd(extension_filter, current_dir=""): + try: + return list_filter_files(extension_filter, current_dir) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of filtered files in current working directory with the list_filter_files_cwd() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ list_match_files function ] (list) +# returns a list of all files that match the developer specified wildcard match pattern +# can optionally specify return of full path to the files (rather than relative path from cwd) by setting full_path to True +# Usage examples: +# file_list = list_match_files("*.py") +# file_list_fullpath = list_match_files("*.py", True) +# Tests: test_SYSTEM.py :: test_sys_match_files, test_sys_match_files_fullpath +#------------------------------------------------------------------------------ +def list_match_files(match_pattern, full_path = False): + try: + from glob import glob + filenames = glob(match_pattern) + if full_path: + filenames_fullpath = [] + cwd = os.getcwd() + for name in filenames: + name = os.path.join(cwd, name) #make the full path to the file + filenames_fullpath.append(name) #add to the new list + return filenames_fullpath #then return that list + else: + return filenames + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return list of matched files with the list_match_files() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# SYMBOLIC LINK TESTING +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ is_link function ] (boolean) +# return boolean indicating whether the path is a symbolic link +#------------------------------------------------------------------------------ +def is_link(filepath): + try: + return os.path.islink(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to determine whether path is a symbolic link with the is_link() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ real_path function ] (string) +# return the real file path pointed to by a symbolic link +#------------------------------------------------------------------------------ +def real_path(filepath): + try: + return os.path.realpath(filepath) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to return real path for symbolic link with the real_path() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# DATA STREAMS +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ stdout function ] +# print to std output stream +#------------------------------------------------------------------------------ +def stdout(text): + try: + print(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_xnl function ] +# print to std output stream without a newline +#------------------------------------------------------------------------------ +def stdout_xnl(text): + try: + sys.stdout.write(text) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_xnl() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stdout_iter function ] +# print items in an iterable to the standard output stream with newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter(iter): + try: + for x in iter: + stdout(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + + +#------------------------------------------------------------------------------ +# [ stdout_iter_xnl function ] +# print items in an iterable to the standard output stream without newlines after each string +#------------------------------------------------------------------------------ +def stdout_iter_xnl(iter): + try: + for x in iter: + stdout_xnl(x) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard output stream with the stdout_iter() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr function ] +# print to std error stream +# optionally (i.e. if exit = nonzero integer) permits exit from application with developer defined exit code +#------------------------------------------------------------------------------ +def stderr(text, exit=0): + try: + sys.stderr.write(text + "\n") + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# [ stderr_xnl function ] +# print to the standard error stream without a newline character after the `text` string +#------------------------------------------------------------------------------ +def stderr_xnl(text, exit=0): + try: + sys.stderr.write(text) + if exit: + raise SystemExit(exit) + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to print to the standard error stream with the stderr() function (Naked.toolshed.system).") + raise e + +#------------------------------------------------------------------------------ +# +# APPLICATION CONTROL +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# [ exit_with_status function ] +# application exit with developer specified exit status code (default = 0) +# use an exit status integer argument +# Tests: test_SYSTEM.py :: test_sys_exit_with_code +#------------------------------------------------------------------------------ +def exit_with_status(exit=0): + raise SystemExit(exit) + +#------------------------------------------------------------------------------ +# [ exit_fail function ] +# application exit with status code 1 +# Tests: test_SYSTEM.py :: test_sys_exit_failure +#------------------------------------------------------------------------------ +def exit_fail(): + raise SystemExit(1) + +#------------------------------------------------------------------------------ +# [ exit_success function] +# application exit with status code 0 +# Tests: test_SYSTEM.py :: test_sys_exit_success +#------------------------------------------------------------------------------ +def exit_success(): + raise SystemExit(0) + + + +if __name__ == '__main__': + pass + # #------------------------------------------------------------------------------ + # # Standard Output Tests + # #------------------------------------------------------------------------------ + # stdout("This is a test") + # for x in range(10): + # stdout_xnl(str(x) + " ") + # list_ten = ['10% ', '20% ', '30% ', '40% ', '50% ', '60% ', '70% ', '80% ', '90% ', '100%'] + # stdout_iter(list_ten) + # #------------------------------------------------------------------------------ + # # Standard Error Tests + # #------------------------------------------------------------------------------ + # stderr("This is a test") + # stderr("This is a test", 1) #exit with status code 1 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/types.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/types.py new file mode 100644 index 00000000..36ac481d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/Naked/toolshed/types.py @@ -0,0 +1,992 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import sys +from Naked.settings import debug as DEBUG_FLAG + +#------------------------------------------------------------------------------ +# [[ NakedObject class ]] +# A generic Python object +# Assigns object attributes by key name in the dictionary argument to the constructor +# The methods are inherited by other mutable Naked object extension types +# Attribute accessors: hasattr, getattr, setattr, delattr +#------------------------------------------------------------------------------ +class NakedObject(object): + # initialize with an attributes dictionary {attribute_name: attribute_value} + def __init__(self, attributes={}, naked_type='NakedObject'): + if len(attributes) > 0: + for key in attributes: + setattr(self, key, attributes[key]) + setattr(self, '_naked_type_', naked_type) # maintain an attribute to keep track of the extension type + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ _equal_type method ] (boolean) + # returns boolean for type of instance == type of test parameter instance + #------------------------------------------------------------------------------ + def _equal_type(self, other_obj): + return type(self) == type(other_obj) + + #------------------------------------------------------------------------------ + # [ _equal_attributes metod ] (method) + # returns boolean for instance.__dict__ == test parameter .__dict__ (attribute comparison) + #------------------------------------------------------------------------------ + def _equal_attributes(self, other_obj): + return self.__dict__ == other_obj.__dict__ + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # equality testing based on type and attributes + # **NEED TO OVERRIDE IN CLASSES THAT INHERIT + #------------------------------------------------------------------------------ + def equals(self, other_obj): + return self._equal_type(other_obj) and self._equal_attributes(other_obj) + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + +#------------------------------------------------------------------------------ +# [[ XDict class ]] +# An inherited extension to the dictionary type +#------------------------------------------------------------------------------ +class XDict(dict, NakedObject): + def __init__(self, dict_obj, attributes={}, naked_type='XDict'): + dict.__init__(self, dict_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XDict Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + overload + # overwrites existing keys with key:value pairs from new dictionaries if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __add__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # +- overload + # overwrites existing keys with another_dict (right sided argument) keys if they are the same keys + # returns the updated XDict object + #------------------------------------------------------------------------------ + def __iadd__(self, other_dict): + try: + self.update(other_dict) + if hasattr(other_dict, '_naked_type_') and (getattr(other_dict, '_naked_type_') == 'XDict'): + attr_dict = other_dict._getAttributeDict() # get the attributes from the parameter XDict and add to new XDict + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XDict with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XDict (type, attributes, dictionary equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if dict(self) == dict(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XDict Value Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ conditional_map_to_vals method ] (XDict) + # returns the original XDict with values that meet True condition in `conditional_function` + # modified as per the `mapped_function` with single value argument call + # Test: test_xdict_conditional_map + #------------------------------------------------------------------------------ + def conditional_map_to_vals(self, conditional_function, mapped_function): + for key, value in self.xitems(): + if conditional_function(key): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ map_to_vals method ] (XDict) + # returns the original XDict with all values modified as per the `mapped_function` + # Test: test_xdict_map_to_vals + #------------------------------------------------------------------------------ + def map_to_vals(self, mapped_function): + # return XDict( zip(self, map(mapped_function, self.values())), self._getAttributeDict() ) - slower in Py2 + for key, value in self.xitems(): + self[key] = mapped_function(value) + return self + + #------------------------------------------------------------------------------ + # [ val_xlist method ] (XList) + # return an XList of the values in the XDict + # Test: test_xdict_val_xlist + #------------------------------------------------------------------------------ + def val_xlist(self): + return XList(self.values(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ max_val method ] (tuple of maximum value and associated key) + # Test: test_xdict_max_val, test_xdict_max_val_strings (strings are alphabetic if not numerals) + #------------------------------------------------------------------------------ + def max_val(self): + return max(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ min_val method ] (tuple of minimum value and associated key) + #------------------------------------------------------------------------------ + def min_val(self): + return min(zip(self.values(), self.keys())) + + #------------------------------------------------------------------------------ + # [ sum_vals method ] (numeric return type dependent upon original value type) + # returns sum of all values in the dictionary + #------------------------------------------------------------------------------ + def sum_vals(self): + return sum(self.values()) + + #------------------------------------------------------------------------------ + # [ val_count method ] (integer) + # returns an integer value for the total count of `value_name` in the dictionary values + # Case sensitive test if comparing strings + # Tests: test_xdict_val_count_string, test_xdict_val_count_integer + #------------------------------------------------------------------------------ + def val_count(self, value_name): + count = 0 + for test_value in self.values(): + if value_name == test_value: + count += 1 + return count + + #------------------------------------------------------------------------------ + # [ value_count_ci method ] (integer) + # returns an integer value for the total count of case insensitive `value_name` + # strings/char in the dictionary values. Can include non-string types (ignores them) + # Test: test_xdict_val_count_ci + #------------------------------------------------------------------------------ + def val_count_ci(self, value_name): + count = 0 + for test_value in self.values(): + try: + if value_name.lower() in test_value.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + + #------------------------------------------------------------------------------ + # XDict Key Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ difference method ] (difference set of keys) + # definition: keys that are included in self, but not in `another_dict` + # Tests: test_xdict_key_difference, test_xdict_key_difference_when_none_present + #------------------------------------------------------------------------------ + def difference(self, another_dict): + return set(self.keys()) - set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ intersection method ] (intersection set of keys) + # definition: keys that are included in both self and `another_dict` + # Tests: test_xdict_key_intersection, test_xdict_key_intersection_when_none_present + #------------------------------------------------------------------------------ + def intersection(self, another_dict): + return set(self.keys()) & set(another_dict.keys()) + + #------------------------------------------------------------------------------ + # [ key_xlist method ] (XList) + # returns an XList of the keys in the XDict + # Test: test_xdict_key_xlist + #------------------------------------------------------------------------------ + def key_xlist(self): + return XList(self.keys(), self._getAttributeDict()) + + #------------------------------------------------------------------------------ + # [ random method ] (dictionary) + # return new Python dictionary with single, random key:value pair + # Test: test_xdict_key_random + #------------------------------------------------------------------------------ + def random(self): + import random + from Naked.toolshed.python import py_major_version + random_key_list = random.sample(self.keys(), 1) + the_key = random_key_list[0] + return {the_key: self[the_key]} + + #------------------------------------------------------------------------------ + # [ random_sample method ] (dictionary) + # return new Python dictionary with `number_of_items` random key:value pairs + # Test: test_xdict_key_random_sample + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + random_key_list = random.sample(self.keys(), number_of_items) + new_dict = {} + for item in random_key_list: + new_dict[item] = self[item] + return new_dict + + #------------------------------------------------------------------------------ + # [ xitems method ] (tuple) + # Generator method that returns tuples of every key, value in dictionary + # uses appropriate method from Python 2 and 3 interpreters + # Test: test_xdict_xitems + #------------------------------------------------------------------------------ + def xitems(self): + from Naked.toolshed.python import py_major_version + if py_major_version() > 2: + return self.items() + else: + return self.iteritems() + +#------------------------------------------------------------------------------ +# [[ XList class ]] +# An inherited extension to the list object that permits attachment of attributes +#------------------------------------------------------------------------------ +class XList(list, NakedObject): + def __init__(self, list_obj, attributes={}, naked_type='XList'): + list.__init__(self, list_obj) + NakedObject.__init__(self, attributes, naked_type) + + #------------------------------------------------------------------------------ + # XList Operator Overloads + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # + operator overload + # extends XList with one or more other lists (`*other_lists`) + #------------------------------------------------------------------------------ + def __add__(self, *other_lists): + try: + for the_list in other_lists: + # add attributes if it is an XList + if hasattr(the_list, '_naked_type_') and (getattr(the_list, '_naked_type_') == 'XList'): + attr_dict = the_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(the_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # += overload + # extends XList with one other list (`another_list`) + #------------------------------------------------------------------------------ + def __iadd__(self, another_list): + try: + #add attributes if it is an XList + if hasattr(another_list, '_naked_type_') and (getattr(another_list, '_naked_type_') == 'XList'): + attr_dict = another_list._getAttributeDict() # get XList attribute dictionary + if len(attr_dict) > 0: + for key in attr_dict: + setattr(self, key, attr_dict[key]) + # extend the XList items + self.extend(another_list) + return self + except Exception as e: + if DEBUG_FLAG: + sys.stderr.write("Naked Framework Error: unable to combine XList with parameter provided (Naked.toolshed.types.py)") + raise e + + #------------------------------------------------------------------------------ + # == overload + #------------------------------------------------------------------------------ + def __eq__(self, other_obj): + return self.equals(other_obj) + + #------------------------------------------------------------------------------ + # != overload + #------------------------------------------------------------------------------ + def __ne__(self, other_obj): + result = self.equals(other_obj) + if result: + return False # reverse result of the equals method + else: + return True + + #------------------------------------------------------------------------------ + # [ equals method ] (boolean) + # tests for equality of the XList (type, attributes, list equality) + #------------------------------------------------------------------------------ + def equals(self, other_obj): + if self._equal_type(other_obj) and self._equal_attributes(other_obj): + if list(self) == list(other_obj): + return True + else: + return False + else: + return False + + #------------------------------------------------------------------------------ + # XList Methods + #------------------------------------------------------------------------------ + + #------------------------------------------------------------------------------ + # XList String Methods + #------------------------------------------------------------------------------ + # [ join method ] (string) + # Concatenate strings in the list and return + # Default separator between string list values is an empty string + # Pass separator character(s) as an argument to the method + #------------------------------------------------------------------------------ + def join(self, separator=""): + return separator.join(self) + + #------------------------------------------------------------------------------ + # [ postfix method ] (list of strings) + # Append a string to each list item string + #------------------------------------------------------------------------------ + def postfix(self, after): + return [ "".join([x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # [ prefix method ] (list of strings) + # Prepend a string to each list item string + #------------------------------------------------------------------------------ + def prefix(self, before): + return [ "".join([before, x]) for x in self ] + + #------------------------------------------------------------------------------ + # [ surround method ] (list of strings) + # Surround each list item string with a before and after string argument passed to the method + #------------------------------------------------------------------------------ + def surround(self, before, after=""): + if after == "": + after = before + return [ "".join([before, x, after]) for x in self ] + + #------------------------------------------------------------------------------ + # XList Numeric Methods + #------------------------------------------------------------------------------ + # [ max method ] (list dependent type, single value) + # return maximum value from the list items + #------------------------------------------------------------------------------ + def max(self): + return max(self) + + #------------------------------------------------------------------------------ + # [ min method ] (list dependent type, single value) + # return minimum value from the list items + #------------------------------------------------------------------------------ + def min(self): + return min(self) + + #------------------------------------------------------------------------------ + # [ sum method ] (list dependent type, single value) + # return the sum of all list items + #------------------------------------------------------------------------------ + def sum(self): + return sum(self) + + #------------------------------------------------------------------------------ + # XList Data Management Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_duplicates method ] (integer) + # returns an integer count of number of duplicate values + #------------------------------------------------------------------------------ + def count_duplicates(self): + return len(self) - len(set(self)) + + #------------------------------------------------------------------------------ + # [ remove_duplicates ] (XList) + # returns a new XList with duplicates removed + #------------------------------------------------------------------------------ + def remove_duplicates(self): + return XList( set(self), self._getAttributeDict() ) + + #------------------------------------------------------------------------------ + # [ difference method ] (set) + # returns a set containing items in XList that are not contained in `another_list` + #------------------------------------------------------------------------------ + def difference(self, another_list): + return set(self) - set(another_list) + + #------------------------------------------------------------------------------ + # [ intersection method ] (set) + # returns a set containing items that are in both XList and `another_list` + #------------------------------------------------------------------------------ + def intersection(self, another_list): + return set(self) & set(another_list) + + #------------------------------------------------------------------------------ + # XList Function Mapping Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ map_to_items method ] (XList) + # returns original XList with modification of each item based upon `mapped_function` + #------------------------------------------------------------------------------ + def map_to_items(self, mapped_function): + # return XList( map(mapped_function, self), self._getAttributeDict() ) - slower + for index, item in enumerate(self): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # [ conditional_map_to_items method ] (XList) + # returns original XList with modification of items that meet True condition in + # `conditional_function` with change performed as defined in `mapped_function` + #------------------------------------------------------------------------------ + def conditional_map_to_items(self, conditional_function, mapped_function): + for index, item in enumerate(self): + if conditional_function(item): + self[index] = mapped_function(item) + return self + + #------------------------------------------------------------------------------ + # XList Descriptive Stats Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ count_ci method ] (integer) + # returns an integer count of the number of case-insensitive items that match `test_string` + #------------------------------------------------------------------------------ + def count_ci(self, test_string): + count = 0 + for item in self: + try: + if test_string.lower() in item.lower(): + count += 1 + except AttributeError: # the test_value was not a string, catch exception and continue count attempt + continue + return count + + #------------------------------------------------------------------------------ + # [ random method ] (list) + # returns a single item list with a random element from the original XList + #------------------------------------------------------------------------------ + def random(self): + import random + return random.choice(self) + + #------------------------------------------------------------------------------ + # [ random_sample method ] (list) + # returns a list with one or more random items from the original XList + # number of items determined by the `number_of_items` argument + #------------------------------------------------------------------------------ + def random_sample(self, number_of_items): + import random + return random.sample(self, number_of_items) + + #------------------------------------------------------------------------------ + # [ shuffle method ] (XList) + # randomly shuffle the contents of the list + #------------------------------------------------------------------------------ + def shuffle(self): + import random + random.shuffle(self) + return self + + #------------------------------------------------------------------------------ + # XList Match Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ wildcard_match method ] (list) + # returns a list of items that match the `wildcard` argument + #------------------------------------------------------------------------------ + def wildcard_match(self, wildcard): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + return [ x for x in self if fnmatchcase(x, wildcard) ] + + #------------------------------------------------------------------------------ + # [ multi_wildcard_match method ] (list) + # returns a list of items that match one or more | separated wildcards passed as string + #------------------------------------------------------------------------------ + def multi_wildcard_match(self, wildcards): + if hasattr(self, 'nkd_fnmatchcase'): + fnmatchcase = self.nkd_fnmatchcase + else: + from fnmatch import fnmatchcase + self.nkd_fnmatchcase = fnmatchcase + wc_list = wildcards.split('|') + return_list = [] + for wc in wc_list: + temp_list = [ x for x in self if fnmatchcase(x, wc) ] + for result in temp_list: + return_list.append(result) + return return_list + + #------------------------------------------------------------------------------ + # XList Cast Methods + #------------------------------------------------------------------------------ + #------------------------------------------------------------------------------ + # [ xset method ] (XSet) + # return an XSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xfset method ] (XFSet) + # return an XFSet with unique XList item values and XList attributes + #------------------------------------------------------------------------------ + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(set(self), attr_dict) + + #------------------------------------------------------------------------------ + # [ xtuple method ] (XTuple) + # returns an XTuple with XList item values and XList attributes + #------------------------------------------------------------------------------ + def xtuple(self): + attr_dict = self._getAttributeDict() + return XTuple(tuple(self), attr_dict) + +#------------------------------------------------------------------------------ +# [[ XMaxHeap class ]] +# max heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMaxHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMaxHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None + + # push new object and return the highest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (-priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + +#------------------------------------------------------------------------------ +# [[ XMinHeap class ]] +# min heap queue +#------------------------------------------------------------------------------ +from heapq import heappush, heappop +class XMinHeap(NakedObject): + def __init__(self, attributes={}, naked_type='XMinHeap'): + NakedObject.__init__(self, attributes, naked_type) + self._queue = [] + self._index = 0 + + + # length of the queue + def __len__(self): + return len(self._queue) + + # O(log n) complexity + def push(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + + # O(log n) complexity + def pop(self): + if self._queue: + return heappop(self._queue)[-1] + else: + return None # return None if the queue is empty + + # push new object and return the lowest priority object + def pushpop(self, the_object, priority): + heappush(self._queue, (priority, self._index, the_object)) + self._index += 1 + if self._queue: + return heappop(self._queue)[-1] + else: + return None #return None if the queue is empty + + # the length of the queue + def length(self): + return len(self._queue) + +#------------------------------------------------------------------------------ +# [[ XQueue class ]] +# +#------------------------------------------------------------------------------ +from collections import deque +class XQueue(deque, NakedObject): + def __init__(self, initial_iterable=[], attributes={}, max_length=10, naked_type='XQueue'): + deque.__init__(self, initial_iterable, max_length) + NakedObject.__init__(self, attributes, naked_type) + + +#------------------------------------------------------------------------------ +# [[ XSet class ]] +# An inherited extension to the mutable set object that permits attribute assignment +# Inherits from set and from NakedObject (see methods in NakedObject at top of this module +#------------------------------------------------------------------------------ +class XSet(set, NakedObject): + def __init__(self, set_obj, attributes={}, naked_type='XSet'): + set.__init__(self, set_obj) + NakedObject.__init__(self, attributes, naked_type) + + # += operator overload to extend the XSet with a second set + def __iadd__(self, another_set): + self.update(another_set) + return self + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict) + + def xfset(self): + attr_dict = self._getAttributeDict() + return XFSet(self, attr_dict) + +#------------------------------------------------------------------------------ +# [[ XFSet class ]] +# An inherited extension to the immutable frozenset object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +#------------------------------------------------------------------------------ +class XFSet(frozenset): + def __new__(cls, the_set, attributes={}, naked_type="XFSet"): + set_obj = frozenset.__new__(cls, the_set) + if len(attributes) > 0: + for key in attributes: + setattr(set_obj, key, attributes[key]) + setattr(set_obj, '_naked_type_', naked_type) # set the naked extension type as an attribute (NakedObject does this for mutable classes) + return set_obj + + def _getAttributeDict(self): + return self.__dict__ + + def xlist(self): + attr_dict = self._getAttributeDict() + return XList(list(self), attr_dict, naked_type="XList") + + def xset(self): + attr_dict = self._getAttributeDict() + return XSet(self, attr_dict, naked_type="XSet") + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XString class ]] +# An inherited extension to the immutable string object that permits attribute assignment +# Immutable so there is no setter method, attributes must be set in the constructor +# Python 2: byte string by default, can cast to normalized UTF-8 with XString().unicode() method +# Python 3: string (that permits unicode) by default, can normalize with XString().unicode() method +#------------------------------------------------------------------------------ +class XString(str): + def __new__(cls, string_text, attributes={}, naked_type='XString'): + str_obj = str.__new__(cls, string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) + return str_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the XString instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + ## TODO: see where + vs. join breakpoint becomes important + def concat(self, *strings): + str_list = [] + for x in strings: + str_list.append(x) + return "".join(str_list) + + # fastest substring search truth test + def contains(self, substring): + return substring in self + + # split the string on one or more delimiters, return list + # if up to two chars, then uses str.split(), if more chars then use re.split + def xsplit(self, split_delimiter): + length = len(split_delimiter) + if length > 2: + import re + split_delimiter = "".join([ '[', split_delimiter, ']' ]) + return re.split(split_delimiter, self) + elif length > 1: + delim2 = split_delimiter[1] + first_list = self.split(split_delimiter[0]) + result_list = [] + for item in first_list: + for subitem in item.split(delim2): + result_list.append(subitem) + return result_list + else: + return self.split(split_delimiter) + + # split the string on one or more characters and return items in set + def xsplit_set(self, split_delimiter): + return set(self.xsplit(split_delimiter)) + + # str begins with substring - faster than str.startswith() + def begins(self, begin_string): + return begin_string in self[0:len(begin_string)] + + # str ends with substring - faster than str.endswith() + def ends(self, end_string): + return end_string in self[-len(end_string):] + + # case sensitive wildcard match on the XString (boolean returned) + def wildcard_match(self, wildcard): + from fnmatch import fnmatchcase + return fnmatchcase(self, wildcard) + + # convert string to normalized UTF-8 in Python 2 and 3 (##TODO: convert to XUnicode with attributes?) + def unicode(self): + from sys import version_info + from unicodedata import normalize + if version_info[0] == 2: + return normalize('NFKD', self.decode('UTF-8')) + else: + return normalize('NFKD', self) + + +# this version works +class XUnicode: + def __init__(self, string_text, attributes={}, naked_type='XUnicode'): + import sys + import unicodedata + norm_text = unicodedata.normalize('NFKD', string_text) + + class XUnicode_2(unicode): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode2'): + str_obj = unicode.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode2 for Py 2 strings + return str_obj + + class XUnicode_3(str): + def __new__(cls, the_string_text, attributes={}, naked_type='XUnicode3'): + str_obj = str.__new__(cls, the_string_text) + if len(attributes) > 0: + for key in attributes: + setattr(str_obj, key, attributes[key]) + setattr(str_obj, '_naked_type_', naked_type) # set the type to XUnicode3 for Py 3 strings + return str_obj + + + if sys.version_info[0] == 2: + self.obj = XUnicode_2(norm_text, attributes) + self.norm_unicode = norm_text + self.naked_u_string = self.obj.encode('utf-8') # utf-8 encoded byte string + elif sys.version_info[0] == 3: + self.naked_u_string = XUnicode_3(norm_text, attributes).encode('utf-8') # ? + + def __str__(self): + # return self.naked_u_string + return self.obj + + def __repr__(self): + return self.naked_u_string + + def __getattr__(self, the_attribute): + return self.obj.__dict__[the_attribute] + + def __cmp__(self, other_string): + return hash(self.naked_u_string) == hash(other_string) + # TODO: add check for same attributes + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +#------------------------------------------------------------------------------ +# [[ XTuple class ]] +# +#------------------------------------------------------------------------------ +class XTuple(tuple): + def __new__(cls, the_tuple, attributes={}, naked_type='XTuple'): + tup_obj = tuple.__new__(cls, the_tuple) + if len(attributes) > 0: + for key in attributes: + setattr(tup_obj, key, attributes[key]) + setattr(tup_obj, '_naked_type_', naked_type) + return tup_obj + + #------------------------------------------------------------------------------ + # [ _getAttributeDict method ] (dictionary) + # returns a dictionary of the NakedObject instance attributes + #------------------------------------------------------------------------------ + def _getAttributeDict(self): + return self.__dict__ + + #------------------------------------------------------------------------------ + # [ type method ] (string) + # returns the Naked type extension string that is set in the constructor for each object type + #------------------------------------------------------------------------------ + def type(self): + if hasattr(self, '_naked_type_'): + return self._naked_type_ + else: + return None + + +if __name__ == '__main__': + pass + # no = nobj({"version":"1.0.1", "test":"code"}) + # print(no) + # print(no.version) + # print(no.test) + # nl = XList([1, 2, 3, 1, 2, 5], {"version":"1.0.1", "test":"code"}) + # print(nl.count_duplicates()) + # the_list = list(range(5000)) + # nl = XList(the_list) + # nq = XPriorityQueue() + # nq.push('test', 5) + # nq.push('one', 3) + # nq.push('another', 4) + # print(nq.pop()) + # print(nq.pop()) + # print(nq.pop()) + + # nl = XList([2, 2, 2, 'another'], {'p': 'attribute'}) + # print(nl) + # print(nl.count_item(2)) + # nq = XQueue(nl, max_length=2) + # print(nq) + + # xs = XSet({'test', 'true', 'false'}, {'bonus': 'candy', 'test': 'another'}) + # xs += {'bogus', 'yep'} + # print(xs) + + # xd = XDict({'test2': 0, 'is': 1}, {'a': '1', 'b': '2'}) + # ad = {'test': 0, 'is': 2} + # ld = xd.intersection(ad) + # print(ld) + # xd = xd + ad + ld + # print(xd.map_to_vals(pr)) + # print(xd.a) + # print(xd) + # print(xd.a) + # print(xd.min_val()) + # print(xd.conditional_map_to_vals(matcher, resulter)) + + # nl = XList([ 'test.txt', 'bogus.txt', 'test.py', 'another.rb', 'est.doc', 'est.py' ]) + # print(nl.multi_wildcard_match('*.py|*.txt|*.doc')) + + # xstr = XString("Hey! Cœur It's Bengali ব য,\nand here is some more ২") + # ustr = xstr.unicode() + # print(isinstance(ustr, bytes)) + # print(xstr) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/INSTALLER b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE new file mode 100644 index 00000000..e8f88054 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2017-2019 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/METADATA b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/METADATA new file mode 100644 index 00000000..27833de2 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/METADATA @@ -0,0 +1,40 @@ +Metadata-Version: 2.1 +Name: PyYAML +Version: 5.3 +Summary: YAML parser and emitter for Python +Home-page: https://github.com/yaml/pyyaml +Author: Kirill Simonov +Author-email: xi@resolvent.net +License: MIT +Download-URL: https://pypi.org/project/PyYAML/ +Platform: Any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Cython +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Processing :: Markup + +YAML is a data serialization format designed for human readability +and interaction with scripting languages. PyYAML is a YAML parser +and emitter for Python. + +PyYAML features a complete YAML 1.1 parser, Unicode support, pickle +support, capable extension API, and sensible error messages. PyYAML +supports standard YAML tags and provides Python-specific tags that +allow to represent an arbitrary Python object. + +PyYAML is applicable for a broad range of tasks from complex +configuration files to object serialization and persistence. + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/RECORD new file mode 100644 index 00000000..6e6d6f04 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/RECORD @@ -0,0 +1,40 @@ +PyYAML-5.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +PyYAML-5.3.dist-info/LICENSE,sha256=oq25yVm3l0lKDvgL32DiLbJ0nuPgwJCFVuPrVI-WfFY,1101 +PyYAML-5.3.dist-info/METADATA,sha256=qeUmOwAa8JaIGvO7rR36WWVTAyA6OjLbv80lirmn4KI,1688 +PyYAML-5.3.dist-info/RECORD,, +PyYAML-5.3.dist-info/WHEEL,sha256=uaZe_9gV-4T_d4AskuIQkCgcY8wMc0UXsVFnf0_mBGs,106 +_yaml.cp37-win_amd64.pyd,sha256=HZT4Mw2pso_NSjpo0b_yWfgA1VOoKDYGNwlzrHEizfk,275456 +yaml/__init__.py,sha256=d28oT0Lc_XTrMwdoyG_fnl7KLfZzPHAbewmELDwVkyY,13168 +yaml/__pycache__/__init__.cpython-37.pyc,sha256=Y7qK2S427EUBkaLHT88Jj4j7JWHpMstQTLG8xt829Fc,11725 +yaml/__pycache__/composer.cpython-37.pyc,sha256=o-AB_FFFXWcKuUMDBOybna2QFqPak39V4IW6kc2F_TE,3488 +yaml/__pycache__/constructor.cpython-37.pyc,sha256=Ewyv8tdFb_--S5XNJryocatYtydaWfroi2vOn_7e2qU,20078 +yaml/__pycache__/cyaml.cpython-37.pyc,sha256=zzkPNMihZnFmhQbEFfH1PxZB_ptgKHkgMDmX6EUEsCE,3653 +yaml/__pycache__/dumper.cpython-37.pyc,sha256=pMcKtlfPw3YxUL6S1z-Si3G3-aQPb1Dvow5F9Y5CH_g,2028 +yaml/__pycache__/emitter.cpython-37.pyc,sha256=NPeS2S2DD7bMjznq6zDUQpdy1TkCYy3X0mWLEDBuqD4,25278 +yaml/__pycache__/error.cpython-37.pyc,sha256=avR-Yy6zFYjSSARiJ0vUAtBrDhI3EEr881y0z2_z5gE,2239 +yaml/__pycache__/events.cpython-37.pyc,sha256=-nD7nZgeMmLZKJ8Egxo-K3fuC5ahQgwuQ-FDOLvI-aE,4005 +yaml/__pycache__/loader.cpython-37.pyc,sha256=IzU_AO72N9-21gUyeUOzswk7AGyH7VWMIrMl7gLjzhI,2237 +yaml/__pycache__/nodes.cpython-37.pyc,sha256=nmXYTBbdlfAIoCCBKdy87iQlITn46KL-bY5RAJC3HB0,1683 +yaml/__pycache__/parser.cpython-37.pyc,sha256=vJvtDGMLKq3KBVTdWZcbDyW3_8sBqniSFhT9JjxCoyI,11833 +yaml/__pycache__/reader.cpython-37.pyc,sha256=A0B6aXFvd4RF7tL776QVMZIiJXlswA1U7EJ2u0UJMAk,4446 +yaml/__pycache__/representer.cpython-37.pyc,sha256=-YzkdDChgcyKqeH-dLaDuF7SlFIZ9hAfomnefALnqKw,10069 +yaml/__pycache__/resolver.cpython-37.pyc,sha256=LWI5QvDOyESO_rC1rfCuXgo4NYeVzWCLooca8J_hwls,5419 +yaml/__pycache__/scanner.cpython-37.pyc,sha256=dxRi-MAJmkRqpRuZQTDfPr2h137fjwNIrHBgV4X0McY,25779 +yaml/__pycache__/serializer.cpython-37.pyc,sha256=QnGJxSfAPSswA5DQ4rBupqk8qWZ9jS0ifGRjP2oddkE,3318 +yaml/__pycache__/tokens.cpython-37.pyc,sha256=2Gjv3GHgKHAFHGHSlZVmADMvCojRgfVqlWC56Orb7pc,5182 +yaml/composer.py,sha256=_Ko30Wr6eDWUeUpauUGT3Lcg9QPBnOPVlTnIMRGJ9FM,4883 +yaml/constructor.py,sha256=4Pd2pssgKUMGLdS_kW6A4SwC7q0T13-sBrATvNQZCZ0,27321 +yaml/cyaml.py,sha256=LiMkvchNonfoy1F6ec9L2BiUz3r0bwF4hympASJX1Ic,3846 +yaml/dumper.py,sha256=PLctZlYwZLp7XmeUdwRuv4nYOZ2UBnDIUy8-lKfLF-o,2837 +yaml/emitter.py,sha256=jghtaU7eFwg31bG0B7RZea_29Adi9CKmXq_QjgQpCkQ,43006 +yaml/error.py,sha256=Ah9z-toHJUbE9j-M8YpxgSRM5CgLCcwVzJgLLRF2Fxo,2533 +yaml/events.py,sha256=50_TksgQiE4up-lKo_V-nBy-tAIxkIPQxY5qDhKCeHw,2445 +yaml/loader.py,sha256=UVa-zIqmkFSCIYq_PgSGm4NSJttHY2Rf_zQ4_b1fHN0,2061 +yaml/nodes.py,sha256=gPKNj8pKCdh2d4gr3gIYINnPOaOxGhJAUiYhGRnPE84,1440 +yaml/parser.py,sha256=ilWp5vvgoHFGzvOZDItFoGjD6D42nhlZrZyjAwa0oJo,25495 +yaml/reader.py,sha256=0dmzirOiDG4Xo41RnuQS7K9rkY3xjHiVasfDMNTqCNw,6794 +yaml/representer.py,sha256=82UM3ZxUQKqsKAF4ltWOxCS6jGPIFtXpGs7mvqyv4Xs,14184 +yaml/resolver.py,sha256=DJCjpQr8YQCEYYjKEYqTl0GrsZil2H4aFOI9b0Oe-U4,8970 +yaml/scanner.py,sha256=KeQIKGNlSyPE8QDwionHxy9CgbqE5teJEz05FR9-nAg,51277 +yaml/serializer.py,sha256=ChuFgmhU01hj4xgI8GaKv6vfM2Bujwa9i7d2FAHj7cA,4165 +yaml/tokens.py,sha256=lTQIzSVw8Mg9wv459-TjiOQe6wVziqaRlqX2_89rp54,2573 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL new file mode 100644 index 00000000..c4dd0f98 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/PyYAML-5.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: false +Tag: cp37-cp37m-win_amd64 + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/_yaml.cp37-win_amd64.pyd b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/_yaml.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..fdc7ceba74e8c40464f97bd9e0ff02fd5951a4c3 GIT binary patch literal 275456 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 +a1VHzdEFo(h<*|$7$aB-O8NHJFg?EAWUPVql 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

&#? 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 literal 0 HcmV?d00001 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst new file mode 100644 index 00000000..a8d462a7 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/DESCRIPTION.rst @@ -0,0 +1,91 @@ +Documentation: http://chrissimpkins.github.io/crypto/ + +Description +------------- + +crypto provides a simple interface to symmetric Gnu Privacy Guard (gpg) encryption and decryption for one or more files on Unix and Linux platforms. It runs on top of gpg and requires a gpg install on your system. Encryption is performed with the AES256 cipher algorithm. `Benchmarks relative to default gpg settings are available for text and binary file mime types `_. + +crypto provides a number of options including automated tar archives of multiple files prior to encryption, portable ASCII armored encryption formatting, and SHA256 hash digest generation for your encrypted files. You can view all available options in the `usage documentation `_ or with the ``--help`` option. + +Tested in cPython 2.7.x, 3.4.x, and pypy 2.4.x (Python version 2.7.9) + + +Install +--------- + +Install with ``pip`` using the command: + +.. code-block:: bash + + $ pip install crypto + +or `download the source repository `_, unpack it, and navigate to the top level of the repository. Then enter: + +.. code-block:: bash + + $ python setup.py install + + +Upgrade +----------- + +You can upgrade your crypto version with the command: + +.. code-block:: bash + + $ pip install --upgrade crypto + + +Usage +--------- + +Encryption (crypto) +^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ crypto [file path] + +.. code-block:: bash + + $ crypto [directory path] + + +Decryption (decrypto) +^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ decrypto [file path] + +.. code-block:: bash + + $ decrypto [directory path] + + +You can find all available options in the `documentation `_ or by using one of the following commands: + +.. code-block:: bash + + $ crypto --help + $ decrypto --help + + +Frequently Asked Questions +------------------------------- + +`FAQ link `_ + + +Issue Reporting +------------------- + +Issue reporting is available on the `GitHub repository `_ + + +Changelog +------------ + +`Changelog link `_ + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/METADATA b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/METADATA new file mode 100644 index 00000000..a47264e3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/METADATA @@ -0,0 +1,116 @@ +Metadata-Version: 2.0 +Name: crypto +Version: 1.4.1 +Summary: Simple symmetric GPG file encryption and decryption +Home-page: https://github.com/chrissimpkins/crypto +Author: Christopher Simpkins +Author-email: git.simpkins@gmail.com +License: MIT license +Keywords: encryption,decryption,gpg,pgp,openpgp,cipher,AES256,crypto,cryptography,security,privacy +Platform: any +Classifier: Intended Audience :: End Users/Desktop +Classifier: Topic :: Security :: Cryptography +Classifier: Topic :: Security +Classifier: Development Status :: 5 - Production/Stable +Classifier: Natural Language :: English +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX +Classifier: Operating System :: Unix +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 3 +Requires-Dist: Naked +Requires-Dist: shellescape + +Documentation: http://chrissimpkins.github.io/crypto/ + +Description +------------- + +crypto provides a simple interface to symmetric Gnu Privacy Guard (gpg) encryption and decryption for one or more files on Unix and Linux platforms. It runs on top of gpg and requires a gpg install on your system. Encryption is performed with the AES256 cipher algorithm. `Benchmarks relative to default gpg settings are available for text and binary file mime types `_. + +crypto provides a number of options including automated tar archives of multiple files prior to encryption, portable ASCII armored encryption formatting, and SHA256 hash digest generation for your encrypted files. You can view all available options in the `usage documentation `_ or with the ``--help`` option. + +Tested in cPython 2.7.x, 3.4.x, and pypy 2.4.x (Python version 2.7.9) + + +Install +--------- + +Install with ``pip`` using the command: + +.. code-block:: bash + + $ pip install crypto + +or `download the source repository `_, unpack it, and navigate to the top level of the repository. Then enter: + +.. code-block:: bash + + $ python setup.py install + + +Upgrade +----------- + +You can upgrade your crypto version with the command: + +.. code-block:: bash + + $ pip install --upgrade crypto + + +Usage +--------- + +Encryption (crypto) +^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ crypto [file path] + +.. code-block:: bash + + $ crypto [directory path] + + +Decryption (decrypto) +^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + $ decrypto [file path] + +.. code-block:: bash + + $ decrypto [directory path] + + +You can find all available options in the `documentation `_ or by using one of the following commands: + +.. code-block:: bash + + $ crypto --help + $ decrypto --help + + +Frequently Asked Questions +------------------------------- + +`FAQ link `_ + + +Issue Reporting +------------------- + +Issue reporting is available on the `GitHub repository `_ + + +Changelog +------------ + +`Changelog link `_ + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/RECORD new file mode 100644 index 00000000..7900aa2e --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/RECORD @@ -0,0 +1,28 @@ +../../Scripts/crypto.exe,sha256=uTRHqri2ZIdDru7ho-z84kPTb-fnu5PNNTktaC4w2Io,102728 +../../Scripts/decrypto.exe,sha256=UX6m9wpHBkCCCQXS-EgkILS2SVGpK22qDhVZQjWQ4X4,102736 +crypto-1.4.1.data/scripts/crypto,sha256=JiOIH9vUcNmsPUqHi3sD7wa-KshHSSHsWwYxdJxquFU,287 +crypto-1.4.1.data/scripts/decrypto,sha256=GFVx1pyc7wga_NuKaO5IN4VpiC-iB1nXFIzvwRKs-QI,291 +crypto-1.4.1.dist-info/DESCRIPTION.rst,sha256=cUnYN7Bc2SHYRPCbrgoiwqxsilKu-F870exbHPzYyqg,2406 +crypto-1.4.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +crypto-1.4.1.dist-info/METADATA,sha256=kQ8T3QfQ00YZ0ETfqAgpzT7JjQZyAtcbpdD4eO-LyfY,3354 +crypto-1.4.1.dist-info/RECORD,, +crypto-1.4.1.dist-info/WHEEL,sha256=SXYYsi-y-rEGIva8sB8iKF6bAFD6YDhmqHX5hI3fc0o,110 +crypto-1.4.1.dist-info/entry_points.txt,sha256=c4pXwtenCFUlTF9DHcgCWqXZChpJwNtbSjtfQMhrm3M,79 +crypto-1.4.1.dist-info/pydist.json,sha256=Q2O_1hp0_7IBZ-JTH9MYE5-GNhTxeT1KqjRvp6U8YAs,1261 +crypto-1.4.1.dist-info/top_level.txt,sha256=iQrOUgmGXiXK01vJOH4JP-6x-yip7JIM4OEshevZ9wE,7 +crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +crypto/__pycache__/__init__.cpython-37.pyc,, +crypto/__pycache__/app.cpython-37.pyc,, +crypto/__pycache__/decryptoapp.cpython-37.pyc,, +crypto/__pycache__/settings.cpython-37.pyc,, +crypto/app.py,sha256=m9usVyS7G-vg7YYx7rVV1DWohss5xlKKq5vV-viSi8o,13952 +crypto/decryptoapp.py,sha256=5hJEh55vyHSgMUkIp2PdYn5P1Z6qkFdrAnsu8EhJZ8c,22448 +crypto/library/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +crypto/library/__pycache__/__init__.cpython-37.pyc,, +crypto/library/__pycache__/cryptor.cpython-37.pyc,, +crypto/library/__pycache__/hash.cpython-37.pyc,, +crypto/library/__pycache__/package.cpython-37.pyc,, +crypto/library/cryptor.py,sha256=0A6KMRsRo7UpfFw0qTbaVByqIRqO4bGSbckgR9fH-RQ,8934 +crypto/library/hash.py,sha256=HVO5NcCRVHJRYOIAMTHlxzk1wWAeYuon2QwiRHJJaAY,847 +crypto/library/package.py,sha256=mTXHpmJFRKqx_KGRN1bUfSei8duBARZKtH4hBQzXAi4,1754 +crypto/settings.py,sha256=d--yWR6fCw10JO3tyQhCY1z36PzPsW7ElRmcikNd8vg,4506 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL new file mode 100644 index 00000000..f2ddc351 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.22.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt new file mode 100644 index 00000000..ff85480c --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/entry_points.txt @@ -0,0 +1,4 @@ +[console_scripts] +crypto = crypto.app:main +decrypto = crypto.decryptoapp:main + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json new file mode 100644 index 00000000..c05d1712 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/pydist.json @@ -0,0 +1 @@ +{"license": "MIT license", "exports": {"console_scripts": {"crypto": "crypto.app:main", "decrypto": "crypto.decryptoapp:main"}}, "document_names": {"description": "DESCRIPTION.rst"}, "name": "crypto", "metadata_version": "2.0", "contacts": [{"role": "author", "email": "git.simpkins@gmail.com", "name": "Christopher Simpkins"}], "generator": "bdist_wheel (0.22.0)", "commands": {"wrap_console": {"crypto": "crypto.app:main", "decrypto": "crypto.decryptoapp:main"}}, "summary": "Simple symmetric GPG file encryption and decryption", "project_urls": {"Home": "https://github.com/chrissimpkins/crypto"}, "platform": "any", "run_requires": [{"requires": ["Naked", "shellescape"]}], "version": "1.4.1", "keywords": "encryption,decryption,gpg,pgp,openpgp,cipher,AES256,crypto,cryptography,security,privacy", "classifiers": ["Intended Audience :: End Users/Desktop", "Topic :: Security :: Cryptography", "Topic :: Security", "Development Status :: 5 - Production/Stable", "Natural Language :: English", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3"], "extras": []} \ No newline at end of file diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt new file mode 100644 index 00000000..0ed56794 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/crypto-1.4.1.dist-info/top_level.txt @@ -0,0 +1 @@ +crypto diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/METADATA b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/METADATA similarity index 98% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/METADATA rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/METADATA index 90d0c8f9..b64dc49b 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/METADATA +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyOpenRPA -Version: 1.0.41 +Version: 1.0.42 Summary: First open source RPA platform for business Home-page: https://gitlab.com/UnicodeLabs/OpenRPA Author: Ivan Maslov @@ -18,6 +18,7 @@ Requires-Dist: pillow (>=6.0.0) Requires-Dist: keyboard (>=0.13.3) Requires-Dist: pyautogui (>=0.9.44) Requires-Dist: pywin32 (>=224) +Requires-Dist: crypto (>=1.4.1) # OpenRPA First open source RPA platform for business is released! diff --git a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/RECORD similarity index 96% rename from Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/RECORD rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/RECORD index 8ecadf9a..dcc1e92d 100644 --- a/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/RECORD +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/RECORD @@ -1,8 +1,8 @@ -pyOpenRPA-1.0.41.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -pyOpenRPA-1.0.41.dist-info/METADATA,sha256=Yp_YJ3c0_9M4JNzepyJrPqDDp4K4GdCIF98pWtuhLu4,3510 -pyOpenRPA-1.0.41.dist-info/RECORD,, -pyOpenRPA-1.0.41.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 -pyOpenRPA-1.0.41.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 +pyOpenRPA-1.0.42.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyOpenRPA-1.0.42.dist-info/METADATA,sha256=Spesv5ub8aq5ymKhq_1kDDFQ2lrCrTwXfF8PakH7OO8,3542 +pyOpenRPA-1.0.42.dist-info/RECORD,, +pyOpenRPA-1.0.42.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97 +pyOpenRPA-1.0.42.dist-info/top_level.txt,sha256=RPzwQXgYBRo_m5L3ZLs6Voh8aEkMeT29Xsul1w1qE0g,10 pyOpenRPA/Orchestrator/Orchestrator.py,sha256=UKp7eqvWDM91kYLwl2mo0UB8Pw-qu8eJCsR9NEXD1aU,6436 pyOpenRPA/Orchestrator/Processor.py,sha256=kmGNIqe6AZMSrzCt1QlonEy58ecFeLunjo8AeRMsufU,11091 pyOpenRPA/Orchestrator/Server.py,sha256=s1ujCuRX6YxRllqPn541Df4pJP7kOexiS3RIuoT4nyE,22053 @@ -265,7 +265,17 @@ pyOpenRPA/Tools/RobotScreenActive/__pycache__/Monitor.cpython-37.pyc,, pyOpenRPA/Tools/RobotScreenActive/__pycache__/Screen.cpython-37.pyc,, pyOpenRPA/Tools/RobotScreenActive/__pycache__/__init__.cpython-37.pyc,, pyOpenRPA/Tools/RobotScreenActive/__pycache__/__main__.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/Crypter.py,sha256=VRrE5-oQxQtvMEPHM1lMXp2CKnceNBmIWJnsJoJkaVE,3616 +pyOpenRPA/Tools/SafeSource/DistrCreate.py,sha256=-_8BTle57LBKVknnB_3af-LghxrRmRGfRNu08CLNIvY,3232 +pyOpenRPA/Tools/SafeSource/DistrRun.py,sha256=TH4uExbufnOubBrTiO8Ccw00E5K6zaJ59-vApSxQ0iY,6661 +pyOpenRPA/Tools/SafeSource/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyOpenRPA/Tools/SafeSource/__main__.py,sha256=g5aYWnuUZoM2jDX2mSIl9tRAJg05tu5VxD2rGJWcACg,649 +pyOpenRPA/Tools/SafeSource/__pycache__/Crypter.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/DistrCreate.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/DistrRun.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/__init__.cpython-37.pyc,, +pyOpenRPA/Tools/SafeSource/__pycache__/__main__.cpython-37.pyc,, pyOpenRPA/Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 pyOpenRPA/Tools/__pycache__/__init__.cpython-37.pyc,, -pyOpenRPA/__init__.py,sha256=lQ3_677Rja_PqcurcKK5fdhTpkzhXA866JG0Ke-ttxU,175 +pyOpenRPA/__init__.py,sha256=9w2hSRgGrWKyQb3T_j71u7VoYGZsrTZz189nKtqEmOQ,175 pyOpenRPA/__pycache__/__init__.cpython-37.pyc,, diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/WHEEL similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/WHEEL rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/WHEEL diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/top_level.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/top_level.txt similarity index 100% rename from Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.41.dist-info/top_level.txt rename to Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA-1.0.42.dist-info/top_level.txt diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py new file mode 100644 index 00000000..3921c79b --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Tools/SafeSource/Crypter.py @@ -0,0 +1,79 @@ +import os, random, struct +from Crypto.Cipher import AES + +def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): + """ Шифрует файл используя AES (режим CBC) с + заданным ключом. + + key: + Ключ шифрования - строка длиной + 16, 24 или 32 байта. Более длинные ключи + более безопасны. + + in_filename: + Имя входного файла + + out_filename: + Если None, будет использоваться « .enc». + + chunksize: + Устанавливает размер фрагмента, который функция + использует для чтения и шифрования файла.Большие + размеры могут быть быстрее для некоторых файлов и машин. + кусок (chunk) должен делиться на 16. + """ + if not out_filename: + out_filename = in_filename + '.enc' + iv = ''.join(chr(random.randint(0, 0xFF)) for i in range(16)) + iv = iv.encode('utf8')[0:16] + encryptor = AES.new(key, AES.MODE_CBC, iv) + filesize = os.path.getsize(in_filename) + with open(in_filename, 'rb') as infile: + with open(out_filename, 'wb') as outfile: + outfile.write(struct.pack('>> filename = 'somefile; rm -rf ~' +>>> command = 'ls -l {}'.format(filename) +>>> print(command) # executed by a shell: boom! +ls -l somefile; rm -rf ~ +``` + +`quote()` lets you plug the security hole: + +```python +>>> command = 'ls -l {}'.format(quote(filename)) +>>> print(command) +ls -l 'somefile; rm -rf ~' +>>> remote_command = 'ssh home {}'.format(quote(command)) +>>> print(remote_command) +ssh home 'ls -l '"'"'somefile; rm -rf ~'"'"'' +``` + +The quoting is compatible with UNIX shells and with `shlex.split()`: + +```python +>>> remote_command = split(remote_command) +>>> remote_command +['ssh', 'home', "ls -l 'somefile; rm -rf ~'"] +>>> command = split(remote_command[-1]) +>>> command +['ls', '-l', 'somefile; rm -rf ~'] +``` + + +## Usage + +Include `shellescape` in your project setup.py file `install_requires` dependency definition list: + +```python +setup( + ... + install_requires=['shellescape'], + ... +) +``` + +Then import the `quote` function into your module(s) and use it as needed: + +```python +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from shellescape import quote + +filename = "somefile; rm -rf ~" +escaped_shell_command = 'ls -l {}'.format(quote(filename)) +``` + +## License + +[LICENSE](https://github.com/chrissimpkins/shellescape/blob/master/docs/LICENSE) + + + + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD new file mode 100644 index 00000000..ad2e8667 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/RECORD @@ -0,0 +1,11 @@ +shellescape-3.8.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +shellescape-3.8.1.dist-info/METADATA,sha256=0JKCtsUacGFBcPFmQFEXZhf6s6YL1HtvJjUZwwsHwW0,2830 +shellescape-3.8.1.dist-info/RECORD,, +shellescape-3.8.1.dist-info/WHEEL,sha256=8zNYZbwQSXoB9IfXOjPfeNwvAsALAjffgk27FqvCWbo,110 +shellescape-3.8.1.dist-info/top_level.txt,sha256=1nR_M9ikLI5pRQ3rfRuYjdDB9AjP3V9GAQITd5ohg98,12 +shellescape/__init__.py,sha256=J9YVVI_M1jo_ZSqrPd7v379OhwJdfj65HyyrDTIGwAU,71 +shellescape/__pycache__/__init__.cpython-37.pyc,, +shellescape/__pycache__/main.cpython-37.pyc,, +shellescape/__pycache__/settings.cpython-37.pyc,, +shellescape/main.py,sha256=t8Fy42MZOR3BEYyVPAY1ArIbHG_kJANIH7u3XLGm1fE,435 +shellescape/settings.py,sha256=tcr2V8HBzoiMYSqwczFT7HYzKHc6UbR7p7C5Q_LV9T8,494 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL new file mode 100644 index 00000000..8b701e93 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt new file mode 100644 index 00000000..0d98e3a7 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape-3.8.1.dist-info/top_level.txt @@ -0,0 +1 @@ +shellescape diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/__init__.py new file mode 100644 index 00000000..00ba358c --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/__init__.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from .main import quote diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/main.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/main.py new file mode 100644 index 00000000..3409350f --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/main.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + + +_find_unsafe = re.compile(r'[^\w@%+=:,./-]').search + + +def quote(s): + """Return a shell-escaped version of the string *s*.""" + if not s: + return "''" + if _find_unsafe(s) is None: + return s + + # use single quotes, and put single quotes into double quotes + # the string $'b is then quoted as '$'"'"'b' + return "'" + s.replace("'", "'\"'\"'") + "'" diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/settings.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/settings.py new file mode 100644 index 00000000..7600a2f9 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/shellescape/settings.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------ +# Application Name +# ------------------------------------------------------------------------------ +app_name = 'shellescape' + +# ------------------------------------------------------------------------------ +# Version Number +# ------------------------------------------------------------------------------ +major_version = "3" +minor_version = "8" +patch_version = "1" + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/__init__.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/__init__.py new file mode 100644 index 00000000..658a08a6 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/__init__.py @@ -0,0 +1,427 @@ + +from .error import * + +from .tokens import * +from .events import * +from .nodes import * + +from .loader import * +from .dumper import * + +__version__ = '5.3' +try: + from .cyaml import * + __with_libyaml__ = True +except ImportError: + __with_libyaml__ = False + +import io + +#------------------------------------------------------------------------------ +# Warnings control +#------------------------------------------------------------------------------ + +# 'Global' warnings state: +_warnings_enabled = { + 'YAMLLoadWarning': True, +} + +# Get or set global warnings' state +def warnings(settings=None): + if settings is None: + return _warnings_enabled + + if type(settings) is dict: + for key in settings: + if key in _warnings_enabled: + _warnings_enabled[key] = settings[key] + +# Warn when load() is called without Loader=... +class YAMLLoadWarning(RuntimeWarning): + pass + +def load_warning(method): + if _warnings_enabled['YAMLLoadWarning'] is False: + return + + import warnings + + message = ( + "calling yaml.%s() without Loader=... is deprecated, as the " + "default Loader is unsafe. Please read " + "https://msg.pyyaml.org/load for full details." + ) % method + + warnings.warn(message, YAMLLoadWarning, stacklevel=3) + +#------------------------------------------------------------------------------ +def scan(stream, Loader=Loader): + """ + Scan a YAML stream and produce scanning tokens. + """ + loader = Loader(stream) + try: + while loader.check_token(): + yield loader.get_token() + finally: + loader.dispose() + +def parse(stream, Loader=Loader): + """ + Parse a YAML stream and produce parsing events. + """ + loader = Loader(stream) + try: + while loader.check_event(): + yield loader.get_event() + finally: + loader.dispose() + +def compose(stream, Loader=Loader): + """ + Parse the first YAML document in a stream + and produce the corresponding representation tree. + """ + loader = Loader(stream) + try: + return loader.get_single_node() + finally: + loader.dispose() + +def compose_all(stream, Loader=Loader): + """ + Parse all YAML documents in a stream + and produce corresponding representation trees. + """ + loader = Loader(stream) + try: + while loader.check_node(): + yield loader.get_node() + finally: + loader.dispose() + +def load(stream, Loader=None): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + """ + if Loader is None: + load_warning('load') + Loader = FullLoader + + loader = Loader(stream) + try: + return loader.get_single_data() + finally: + loader.dispose() + +def load_all(stream, Loader=None): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + """ + if Loader is None: + load_warning('load_all') + Loader = FullLoader + + loader = Loader(stream) + try: + while loader.check_data(): + yield loader.get_data() + finally: + loader.dispose() + +def full_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve all tags except those known to be + unsafe on untrusted input. + """ + return load(stream, FullLoader) + +def full_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve all tags except those known to be + unsafe on untrusted input. + """ + return load_all(stream, FullLoader) + +def safe_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve only basic YAML tags. This is known + to be safe for untrusted input. + """ + return load(stream, SafeLoader) + +def safe_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve only basic YAML tags. This is known + to be safe for untrusted input. + """ + return load_all(stream, SafeLoader) + +def unsafe_load(stream): + """ + Parse the first YAML document in a stream + and produce the corresponding Python object. + + Resolve all tags, even those known to be + unsafe on untrusted input. + """ + return load(stream, UnsafeLoader) + +def unsafe_load_all(stream): + """ + Parse all YAML documents in a stream + and produce corresponding Python objects. + + Resolve all tags, even those known to be + unsafe on untrusted input. + """ + return load_all(stream, UnsafeLoader) + +def emit(events, stream=None, Dumper=Dumper, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None): + """ + Emit YAML parsing events into a stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + stream = io.StringIO() + getvalue = stream.getvalue + dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + try: + for event in events: + dumper.emit(event) + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def serialize_all(nodes, stream=None, Dumper=Dumper, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None): + """ + Serialize a sequence of representation trees into a YAML stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() + getvalue = stream.getvalue + dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break, + encoding=encoding, version=version, tags=tags, + explicit_start=explicit_start, explicit_end=explicit_end) + try: + dumper.open() + for node in nodes: + dumper.serialize(node) + dumper.close() + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def serialize(node, stream=None, Dumper=Dumper, **kwds): + """ + Serialize a representation tree into a YAML stream. + If stream is None, return the produced string instead. + """ + return serialize_all([node], stream, Dumper=Dumper, **kwds) + +def dump_all(documents, stream=None, Dumper=Dumper, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + """ + Serialize a sequence of Python objects into a YAML stream. + If stream is None, return the produced string instead. + """ + getvalue = None + if stream is None: + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() + getvalue = stream.getvalue + dumper = Dumper(stream, default_style=default_style, + default_flow_style=default_flow_style, + canonical=canonical, indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break, + encoding=encoding, version=version, tags=tags, + explicit_start=explicit_start, explicit_end=explicit_end, sort_keys=sort_keys) + try: + dumper.open() + for data in documents: + dumper.represent(data) + dumper.close() + finally: + dumper.dispose() + if getvalue: + return getvalue() + +def dump(data, stream=None, Dumper=Dumper, **kwds): + """ + Serialize a Python object into a YAML stream. + If stream is None, return the produced string instead. + """ + return dump_all([data], stream, Dumper=Dumper, **kwds) + +def safe_dump_all(documents, stream=None, **kwds): + """ + Serialize a sequence of Python objects into a YAML stream. + Produce only basic YAML tags. + If stream is None, return the produced string instead. + """ + return dump_all(documents, stream, Dumper=SafeDumper, **kwds) + +def safe_dump(data, stream=None, **kwds): + """ + Serialize a Python object into a YAML stream. + Produce only basic YAML tags. + If stream is None, return the produced string instead. + """ + return dump_all([data], stream, Dumper=SafeDumper, **kwds) + +def add_implicit_resolver(tag, regexp, first=None, + Loader=None, Dumper=Dumper): + """ + Add an implicit scalar detector. + If an implicit scalar value matches the given regexp, + the corresponding tag is assigned to the scalar. + first is a sequence of possible initial characters or None. + """ + if Loader is None: + loader.Loader.add_implicit_resolver(tag, regexp, first) + loader.FullLoader.add_implicit_resolver(tag, regexp, first) + loader.UnsafeLoader.add_implicit_resolver(tag, regexp, first) + else: + Loader.add_implicit_resolver(tag, regexp, first) + Dumper.add_implicit_resolver(tag, regexp, first) + +def add_path_resolver(tag, path, kind=None, Loader=None, Dumper=Dumper): + """ + Add a path based resolver for the given tag. + A path is a list of keys that forms a path + to a node in the representation tree. + Keys can be string values, integers, or None. + """ + if Loader is None: + loader.Loader.add_path_resolver(tag, path, kind) + loader.FullLoader.add_path_resolver(tag, path, kind) + loader.UnsafeLoader.add_path_resolver(tag, path, kind) + else: + Loader.add_path_resolver(tag, path, kind) + Dumper.add_path_resolver(tag, path, kind) + +def add_constructor(tag, constructor, Loader=None): + """ + Add a constructor for the given tag. + Constructor is a function that accepts a Loader instance + and a node object and produces the corresponding Python object. + """ + if Loader is None: + loader.Loader.add_constructor(tag, constructor) + loader.FullLoader.add_constructor(tag, constructor) + loader.UnsafeLoader.add_constructor(tag, constructor) + else: + Loader.add_constructor(tag, constructor) + +def add_multi_constructor(tag_prefix, multi_constructor, Loader=None): + """ + Add a multi-constructor for the given tag prefix. + Multi-constructor is called for a node if its tag starts with tag_prefix. + Multi-constructor accepts a Loader instance, a tag suffix, + and a node object and produces the corresponding Python object. + """ + if Loader is None: + loader.Loader.add_multi_constructor(tag_prefix, multi_constructor) + loader.FullLoader.add_multi_constructor(tag_prefix, multi_constructor) + loader.UnsafeLoader.add_multi_constructor(tag_prefix, multi_constructor) + else: + Loader.add_multi_constructor(tag_prefix, multi_constructor) + +def add_representer(data_type, representer, Dumper=Dumper): + """ + Add a representer for the given type. + Representer is a function accepting a Dumper instance + and an instance of the given data type + and producing the corresponding representation node. + """ + Dumper.add_representer(data_type, representer) + +def add_multi_representer(data_type, multi_representer, Dumper=Dumper): + """ + Add a representer for the given type. + Multi-representer is a function accepting a Dumper instance + and an instance of the given data type or subtype + and producing the corresponding representation node. + """ + Dumper.add_multi_representer(data_type, multi_representer) + +class YAMLObjectMetaclass(type): + """ + The metaclass for YAMLObject. + """ + def __init__(cls, name, bases, kwds): + super(YAMLObjectMetaclass, cls).__init__(name, bases, kwds) + if 'yaml_tag' in kwds and kwds['yaml_tag'] is not None: + if isinstance(cls.yaml_loader, list): + for loader in cls.yaml_loader: + loader.add_constructor(cls.yaml_tag, cls.from_yaml) + else: + cls.yaml_loader.add_constructor(cls.yaml_tag, cls.from_yaml) + + cls.yaml_dumper.add_representer(cls, cls.to_yaml) + +class YAMLObject(metaclass=YAMLObjectMetaclass): + """ + An object that can dump itself to a YAML stream + and load itself from a YAML stream. + """ + + __slots__ = () # no direct instantiation, so allow immutable subclasses + + yaml_loader = [Loader, FullLoader, UnsafeLoader] + yaml_dumper = Dumper + + yaml_tag = None + yaml_flow_style = None + + @classmethod + def from_yaml(cls, loader, node): + """ + Convert a representation node to a Python object. + """ + return loader.construct_yaml_object(node, cls) + + @classmethod + def to_yaml(cls, dumper, data): + """ + Convert a Python object to a representation node. + """ + return dumper.represent_yaml_object(cls.yaml_tag, data, cls, + flow_style=cls.yaml_flow_style) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/composer.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/composer.py new file mode 100644 index 00000000..6d15cb40 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/composer.py @@ -0,0 +1,139 @@ + +__all__ = ['Composer', 'ComposerError'] + +from .error import MarkedYAMLError +from .events import * +from .nodes import * + +class ComposerError(MarkedYAMLError): + pass + +class Composer: + + def __init__(self): + self.anchors = {} + + def check_node(self): + # Drop the STREAM-START event. + if self.check_event(StreamStartEvent): + self.get_event() + + # If there are more documents available? + return not self.check_event(StreamEndEvent) + + def get_node(self): + # Get the root node of the next document. + if not self.check_event(StreamEndEvent): + return self.compose_document() + + def get_single_node(self): + # Drop the STREAM-START event. + self.get_event() + + # Compose a document if the stream is not empty. + document = None + if not self.check_event(StreamEndEvent): + document = self.compose_document() + + # Ensure that the stream contains no more documents. + if not self.check_event(StreamEndEvent): + event = self.get_event() + raise ComposerError("expected a single document in the stream", + document.start_mark, "but found another document", + event.start_mark) + + # Drop the STREAM-END event. + self.get_event() + + return document + + def compose_document(self): + # Drop the DOCUMENT-START event. + self.get_event() + + # Compose the root node. + node = self.compose_node(None, None) + + # Drop the DOCUMENT-END event. + self.get_event() + + self.anchors = {} + return node + + def compose_node(self, parent, index): + if self.check_event(AliasEvent): + event = self.get_event() + anchor = event.anchor + if anchor not in self.anchors: + raise ComposerError(None, None, "found undefined alias %r" + % anchor, event.start_mark) + return self.anchors[anchor] + event = self.peek_event() + anchor = event.anchor + if anchor is not None: + if anchor in self.anchors: + raise ComposerError("found duplicate anchor %r; first occurrence" + % anchor, self.anchors[anchor].start_mark, + "second occurrence", event.start_mark) + self.descend_resolver(parent, index) + if self.check_event(ScalarEvent): + node = self.compose_scalar_node(anchor) + elif self.check_event(SequenceStartEvent): + node = self.compose_sequence_node(anchor) + elif self.check_event(MappingStartEvent): + node = self.compose_mapping_node(anchor) + self.ascend_resolver() + return node + + def compose_scalar_node(self, anchor): + event = self.get_event() + tag = event.tag + if tag is None or tag == '!': + tag = self.resolve(ScalarNode, event.value, event.implicit) + node = ScalarNode(tag, event.value, + event.start_mark, event.end_mark, style=event.style) + if anchor is not None: + self.anchors[anchor] = node + return node + + def compose_sequence_node(self, anchor): + start_event = self.get_event() + tag = start_event.tag + if tag is None or tag == '!': + tag = self.resolve(SequenceNode, None, start_event.implicit) + node = SequenceNode(tag, [], + start_event.start_mark, None, + flow_style=start_event.flow_style) + if anchor is not None: + self.anchors[anchor] = node + index = 0 + while not self.check_event(SequenceEndEvent): + node.value.append(self.compose_node(node, index)) + index += 1 + end_event = self.get_event() + node.end_mark = end_event.end_mark + return node + + def compose_mapping_node(self, anchor): + start_event = self.get_event() + tag = start_event.tag + if tag is None or tag == '!': + tag = self.resolve(MappingNode, None, start_event.implicit) + node = MappingNode(tag, [], + start_event.start_mark, None, + flow_style=start_event.flow_style) + if anchor is not None: + self.anchors[anchor] = node + while not self.check_event(MappingEndEvent): + #key_event = self.peek_event() + item_key = self.compose_node(node, None) + #if item_key in node.value: + # raise ComposerError("while composing a mapping", start_event.start_mark, + # "found duplicate key", key_event.start_mark) + item_value = self.compose_node(node, item_key) + #node.value[item_key] = item_value + node.value.append((item_key, item_value)) + end_event = self.get_event() + node.end_mark = end_event.end_mark + return node + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/constructor.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/constructor.py new file mode 100644 index 00000000..cd9167ea --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/constructor.py @@ -0,0 +1,721 @@ + +__all__ = [ + 'BaseConstructor', + 'SafeConstructor', + 'FullConstructor', + 'UnsafeConstructor', + 'Constructor', + 'ConstructorError' +] + +from .error import * +from .nodes import * + +import collections.abc, datetime, base64, binascii, re, sys, types + +class ConstructorError(MarkedYAMLError): + pass + +class BaseConstructor: + + yaml_constructors = {} + yaml_multi_constructors = {} + + def __init__(self): + self.constructed_objects = {} + self.recursive_objects = {} + self.state_generators = [] + self.deep_construct = False + + def check_data(self): + # If there are more documents available? + return self.check_node() + + def get_data(self): + # Construct and return the next document. + if self.check_node(): + return self.construct_document(self.get_node()) + + def get_single_data(self): + # Ensure that the stream contains a single document and construct it. + node = self.get_single_node() + if node is not None: + return self.construct_document(node) + return None + + def construct_document(self, node): + data = self.construct_object(node) + while self.state_generators: + state_generators = self.state_generators + self.state_generators = [] + for generator in state_generators: + for dummy in generator: + pass + self.constructed_objects = {} + self.recursive_objects = {} + self.deep_construct = False + return data + + def construct_object(self, node, deep=False): + if node in self.constructed_objects: + return self.constructed_objects[node] + if deep: + old_deep = self.deep_construct + self.deep_construct = True + if node in self.recursive_objects: + raise ConstructorError(None, None, + "found unconstructable recursive node", node.start_mark) + self.recursive_objects[node] = None + constructor = None + tag_suffix = None + if node.tag in self.yaml_constructors: + constructor = self.yaml_constructors[node.tag] + else: + for tag_prefix in self.yaml_multi_constructors: + if tag_prefix is not None and node.tag.startswith(tag_prefix): + tag_suffix = node.tag[len(tag_prefix):] + constructor = self.yaml_multi_constructors[tag_prefix] + break + else: + if None in self.yaml_multi_constructors: + tag_suffix = node.tag + constructor = self.yaml_multi_constructors[None] + elif None in self.yaml_constructors: + constructor = self.yaml_constructors[None] + elif isinstance(node, ScalarNode): + constructor = self.__class__.construct_scalar + elif isinstance(node, SequenceNode): + constructor = self.__class__.construct_sequence + elif isinstance(node, MappingNode): + constructor = self.__class__.construct_mapping + if tag_suffix is None: + data = constructor(self, node) + else: + data = constructor(self, tag_suffix, node) + if isinstance(data, types.GeneratorType): + generator = data + data = next(generator) + if self.deep_construct: + for dummy in generator: + pass + else: + self.state_generators.append(generator) + self.constructed_objects[node] = data + del self.recursive_objects[node] + if deep: + self.deep_construct = old_deep + return data + + def construct_scalar(self, node): + if not isinstance(node, ScalarNode): + raise ConstructorError(None, None, + "expected a scalar node, but found %s" % node.id, + node.start_mark) + return node.value + + def construct_sequence(self, node, deep=False): + if not isinstance(node, SequenceNode): + raise ConstructorError(None, None, + "expected a sequence node, but found %s" % node.id, + node.start_mark) + return [self.construct_object(child, deep=deep) + for child in node.value] + + def construct_mapping(self, node, deep=False): + if not isinstance(node, MappingNode): + raise ConstructorError(None, None, + "expected a mapping node, but found %s" % node.id, + node.start_mark) + mapping = {} + for key_node, value_node in node.value: + key = self.construct_object(key_node, deep=deep) + if not isinstance(key, collections.abc.Hashable): + raise ConstructorError("while constructing a mapping", node.start_mark, + "found unhashable key", key_node.start_mark) + value = self.construct_object(value_node, deep=deep) + mapping[key] = value + return mapping + + def construct_pairs(self, node, deep=False): + if not isinstance(node, MappingNode): + raise ConstructorError(None, None, + "expected a mapping node, but found %s" % node.id, + node.start_mark) + pairs = [] + for key_node, value_node in node.value: + key = self.construct_object(key_node, deep=deep) + value = self.construct_object(value_node, deep=deep) + pairs.append((key, value)) + return pairs + + @classmethod + def add_constructor(cls, tag, constructor): + if not 'yaml_constructors' in cls.__dict__: + cls.yaml_constructors = cls.yaml_constructors.copy() + cls.yaml_constructors[tag] = constructor + + @classmethod + def add_multi_constructor(cls, tag_prefix, multi_constructor): + if not 'yaml_multi_constructors' in cls.__dict__: + cls.yaml_multi_constructors = cls.yaml_multi_constructors.copy() + cls.yaml_multi_constructors[tag_prefix] = multi_constructor + +class SafeConstructor(BaseConstructor): + + def construct_scalar(self, node): + if isinstance(node, MappingNode): + for key_node, value_node in node.value: + if key_node.tag == 'tag:yaml.org,2002:value': + return self.construct_scalar(value_node) + return super().construct_scalar(node) + + def flatten_mapping(self, node): + merge = [] + index = 0 + while index < len(node.value): + key_node, value_node = node.value[index] + if key_node.tag == 'tag:yaml.org,2002:merge': + del node.value[index] + if isinstance(value_node, MappingNode): + self.flatten_mapping(value_node) + merge.extend(value_node.value) + elif isinstance(value_node, SequenceNode): + submerge = [] + for subnode in value_node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing a mapping", + node.start_mark, + "expected a mapping for merging, but found %s" + % subnode.id, subnode.start_mark) + self.flatten_mapping(subnode) + submerge.append(subnode.value) + submerge.reverse() + for value in submerge: + merge.extend(value) + else: + raise ConstructorError("while constructing a mapping", node.start_mark, + "expected a mapping or list of mappings for merging, but found %s" + % value_node.id, value_node.start_mark) + elif key_node.tag == 'tag:yaml.org,2002:value': + key_node.tag = 'tag:yaml.org,2002:str' + index += 1 + else: + index += 1 + if merge: + node.value = merge + node.value + + def construct_mapping(self, node, deep=False): + if isinstance(node, MappingNode): + self.flatten_mapping(node) + return super().construct_mapping(node, deep=deep) + + def construct_yaml_null(self, node): + self.construct_scalar(node) + return None + + bool_values = { + 'yes': True, + 'no': False, + 'true': True, + 'false': False, + 'on': True, + 'off': False, + } + + def construct_yaml_bool(self, node): + value = self.construct_scalar(node) + return self.bool_values[value.lower()] + + def construct_yaml_int(self, node): + value = self.construct_scalar(node) + value = value.replace('_', '') + sign = +1 + if value[0] == '-': + sign = -1 + if value[0] in '+-': + value = value[1:] + if value == '0': + return 0 + elif value.startswith('0b'): + return sign*int(value[2:], 2) + elif value.startswith('0x'): + return sign*int(value[2:], 16) + elif value[0] == '0': + return sign*int(value, 8) + elif ':' in value: + digits = [int(part) for part in value.split(':')] + digits.reverse() + base = 1 + value = 0 + for digit in digits: + value += digit*base + base *= 60 + return sign*value + else: + return sign*int(value) + + inf_value = 1e300 + while inf_value != inf_value*inf_value: + inf_value *= inf_value + nan_value = -inf_value/inf_value # Trying to make a quiet NaN (like C99). + + def construct_yaml_float(self, node): + value = self.construct_scalar(node) + value = value.replace('_', '').lower() + sign = +1 + if value[0] == '-': + sign = -1 + if value[0] in '+-': + value = value[1:] + if value == '.inf': + return sign*self.inf_value + elif value == '.nan': + return self.nan_value + elif ':' in value: + digits = [float(part) for part in value.split(':')] + digits.reverse() + base = 1 + value = 0.0 + for digit in digits: + value += digit*base + base *= 60 + return sign*value + else: + return sign*float(value) + + def construct_yaml_binary(self, node): + try: + value = self.construct_scalar(node).encode('ascii') + except UnicodeEncodeError as exc: + raise ConstructorError(None, None, + "failed to convert base64 data into ascii: %s" % exc, + node.start_mark) + try: + if hasattr(base64, 'decodebytes'): + return base64.decodebytes(value) + else: + return base64.decodestring(value) + except binascii.Error as exc: + raise ConstructorError(None, None, + "failed to decode base64 data: %s" % exc, node.start_mark) + + timestamp_regexp = re.compile( + r'''^(?P[0-9][0-9][0-9][0-9]) + -(?P[0-9][0-9]?) + -(?P[0-9][0-9]?) + (?:(?:[Tt]|[ \t]+) + (?P[0-9][0-9]?) + :(?P[0-9][0-9]) + :(?P[0-9][0-9]) + (?:\.(?P[0-9]*))? + (?:[ \t]*(?PZ|(?P[-+])(?P[0-9][0-9]?) + (?::(?P[0-9][0-9]))?))?)?$''', re.X) + + def construct_yaml_timestamp(self, node): + value = self.construct_scalar(node) + match = self.timestamp_regexp.match(node.value) + values = match.groupdict() + year = int(values['year']) + month = int(values['month']) + day = int(values['day']) + if not values['hour']: + return datetime.date(year, month, day) + hour = int(values['hour']) + minute = int(values['minute']) + second = int(values['second']) + fraction = 0 + tzinfo = None + if values['fraction']: + fraction = values['fraction'][:6] + while len(fraction) < 6: + fraction += '0' + fraction = int(fraction) + if values['tz_sign']: + tz_hour = int(values['tz_hour']) + tz_minute = int(values['tz_minute'] or 0) + delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute) + if values['tz_sign'] == '-': + delta = -delta + tzinfo = datetime.timezone(delta) + elif values['tz']: + tzinfo = datetime.timezone.utc + return datetime.datetime(year, month, day, hour, minute, second, fraction, + tzinfo=tzinfo) + + def construct_yaml_omap(self, node): + # Note: we do not check for duplicate keys, because it's too + # CPU-expensive. + omap = [] + yield omap + if not isinstance(node, SequenceNode): + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a sequence, but found %s" % node.id, node.start_mark) + for subnode in node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a mapping of length 1, but found %s" % subnode.id, + subnode.start_mark) + if len(subnode.value) != 1: + raise ConstructorError("while constructing an ordered map", node.start_mark, + "expected a single mapping item, but found %d items" % len(subnode.value), + subnode.start_mark) + key_node, value_node = subnode.value[0] + key = self.construct_object(key_node) + value = self.construct_object(value_node) + omap.append((key, value)) + + def construct_yaml_pairs(self, node): + # Note: the same code as `construct_yaml_omap`. + pairs = [] + yield pairs + if not isinstance(node, SequenceNode): + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a sequence, but found %s" % node.id, node.start_mark) + for subnode in node.value: + if not isinstance(subnode, MappingNode): + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a mapping of length 1, but found %s" % subnode.id, + subnode.start_mark) + if len(subnode.value) != 1: + raise ConstructorError("while constructing pairs", node.start_mark, + "expected a single mapping item, but found %d items" % len(subnode.value), + subnode.start_mark) + key_node, value_node = subnode.value[0] + key = self.construct_object(key_node) + value = self.construct_object(value_node) + pairs.append((key, value)) + + def construct_yaml_set(self, node): + data = set() + yield data + value = self.construct_mapping(node) + data.update(value) + + def construct_yaml_str(self, node): + return self.construct_scalar(node) + + def construct_yaml_seq(self, node): + data = [] + yield data + data.extend(self.construct_sequence(node)) + + def construct_yaml_map(self, node): + data = {} + yield data + value = self.construct_mapping(node) + data.update(value) + + def construct_yaml_object(self, node, cls): + data = cls.__new__(cls) + yield data + if hasattr(data, '__setstate__'): + state = self.construct_mapping(node, deep=True) + data.__setstate__(state) + else: + state = self.construct_mapping(node) + data.__dict__.update(state) + + def construct_undefined(self, node): + raise ConstructorError(None, None, + "could not determine a constructor for the tag %r" % node.tag, + node.start_mark) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:null', + SafeConstructor.construct_yaml_null) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:bool', + SafeConstructor.construct_yaml_bool) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:int', + SafeConstructor.construct_yaml_int) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:float', + SafeConstructor.construct_yaml_float) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:binary', + SafeConstructor.construct_yaml_binary) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:timestamp', + SafeConstructor.construct_yaml_timestamp) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:omap', + SafeConstructor.construct_yaml_omap) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:pairs', + SafeConstructor.construct_yaml_pairs) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:set', + SafeConstructor.construct_yaml_set) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:str', + SafeConstructor.construct_yaml_str) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:seq', + SafeConstructor.construct_yaml_seq) + +SafeConstructor.add_constructor( + 'tag:yaml.org,2002:map', + SafeConstructor.construct_yaml_map) + +SafeConstructor.add_constructor(None, + SafeConstructor.construct_undefined) + +class FullConstructor(SafeConstructor): + + def construct_python_str(self, node): + return self.construct_scalar(node) + + def construct_python_unicode(self, node): + return self.construct_scalar(node) + + def construct_python_bytes(self, node): + try: + value = self.construct_scalar(node).encode('ascii') + except UnicodeEncodeError as exc: + raise ConstructorError(None, None, + "failed to convert base64 data into ascii: %s" % exc, + node.start_mark) + try: + if hasattr(base64, 'decodebytes'): + return base64.decodebytes(value) + else: + return base64.decodestring(value) + except binascii.Error as exc: + raise ConstructorError(None, None, + "failed to decode base64 data: %s" % exc, node.start_mark) + + def construct_python_long(self, node): + return self.construct_yaml_int(node) + + def construct_python_complex(self, node): + return complex(self.construct_scalar(node)) + + def construct_python_tuple(self, node): + return tuple(self.construct_sequence(node)) + + def find_python_module(self, name, mark, unsafe=False): + if not name: + raise ConstructorError("while constructing a Python module", mark, + "expected non-empty name appended to the tag", mark) + if unsafe: + try: + __import__(name) + except ImportError as exc: + raise ConstructorError("while constructing a Python module", mark, + "cannot find module %r (%s)" % (name, exc), mark) + if name not in sys.modules: + raise ConstructorError("while constructing a Python module", mark, + "module %r is not imported" % name, mark) + return sys.modules[name] + + def find_python_name(self, name, mark, unsafe=False): + if not name: + raise ConstructorError("while constructing a Python object", mark, + "expected non-empty name appended to the tag", mark) + if '.' in name: + module_name, object_name = name.rsplit('.', 1) + else: + module_name = 'builtins' + object_name = name + if unsafe: + try: + __import__(module_name) + except ImportError as exc: + raise ConstructorError("while constructing a Python object", mark, + "cannot find module %r (%s)" % (module_name, exc), mark) + if module_name not in sys.modules: + raise ConstructorError("while constructing a Python object", mark, + "module %r is not imported" % module_name, mark) + module = sys.modules[module_name] + if not hasattr(module, object_name): + raise ConstructorError("while constructing a Python object", mark, + "cannot find %r in the module %r" + % (object_name, module.__name__), mark) + return getattr(module, object_name) + + def construct_python_name(self, suffix, node): + value = self.construct_scalar(node) + if value: + raise ConstructorError("while constructing a Python name", node.start_mark, + "expected the empty value, but found %r" % value, node.start_mark) + return self.find_python_name(suffix, node.start_mark) + + def construct_python_module(self, suffix, node): + value = self.construct_scalar(node) + if value: + raise ConstructorError("while constructing a Python module", node.start_mark, + "expected the empty value, but found %r" % value, node.start_mark) + return self.find_python_module(suffix, node.start_mark) + + def make_python_instance(self, suffix, node, + args=None, kwds=None, newobj=False, unsafe=False): + if not args: + args = [] + if not kwds: + kwds = {} + cls = self.find_python_name(suffix, node.start_mark) + if not (unsafe or isinstance(cls, type)): + raise ConstructorError("while constructing a Python instance", node.start_mark, + "expected a class, but found %r" % type(cls), + node.start_mark) + if newobj and isinstance(cls, type): + return cls.__new__(cls, *args, **kwds) + else: + return cls(*args, **kwds) + + def set_python_instance_state(self, instance, state): + if hasattr(instance, '__setstate__'): + instance.__setstate__(state) + else: + slotstate = {} + if isinstance(state, tuple) and len(state) == 2: + state, slotstate = state + if hasattr(instance, '__dict__'): + instance.__dict__.update(state) + elif state: + slotstate.update(state) + for key, value in slotstate.items(): + setattr(instance, key, value) + + def construct_python_object(self, suffix, node): + # Format: + # !!python/object:module.name { ... state ... } + instance = self.make_python_instance(suffix, node, newobj=True) + yield instance + deep = hasattr(instance, '__setstate__') + state = self.construct_mapping(node, deep=deep) + self.set_python_instance_state(instance, state) + + def construct_python_object_apply(self, suffix, node, newobj=False): + # Format: + # !!python/object/apply # (or !!python/object/new) + # args: [ ... arguments ... ] + # kwds: { ... keywords ... } + # state: ... state ... + # listitems: [ ... listitems ... ] + # dictitems: { ... dictitems ... } + # or short format: + # !!python/object/apply [ ... arguments ... ] + # The difference between !!python/object/apply and !!python/object/new + # is how an object is created, check make_python_instance for details. + if isinstance(node, SequenceNode): + args = self.construct_sequence(node, deep=True) + kwds = {} + state = {} + listitems = [] + dictitems = {} + else: + value = self.construct_mapping(node, deep=True) + args = value.get('args', []) + kwds = value.get('kwds', {}) + state = value.get('state', {}) + listitems = value.get('listitems', []) + dictitems = value.get('dictitems', {}) + instance = self.make_python_instance(suffix, node, args, kwds, newobj) + if state: + self.set_python_instance_state(instance, state) + if listitems: + instance.extend(listitems) + if dictitems: + for key in dictitems: + instance[key] = dictitems[key] + return instance + + def construct_python_object_new(self, suffix, node): + return self.construct_python_object_apply(suffix, node, newobj=True) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/none', + FullConstructor.construct_yaml_null) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/bool', + FullConstructor.construct_yaml_bool) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/str', + FullConstructor.construct_python_str) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/unicode', + FullConstructor.construct_python_unicode) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/bytes', + FullConstructor.construct_python_bytes) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/int', + FullConstructor.construct_yaml_int) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/long', + FullConstructor.construct_python_long) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/float', + FullConstructor.construct_yaml_float) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/complex', + FullConstructor.construct_python_complex) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/list', + FullConstructor.construct_yaml_seq) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/tuple', + FullConstructor.construct_python_tuple) + +FullConstructor.add_constructor( + 'tag:yaml.org,2002:python/dict', + FullConstructor.construct_yaml_map) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/name:', + FullConstructor.construct_python_name) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/module:', + FullConstructor.construct_python_module) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object:', + FullConstructor.construct_python_object) + +FullConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object/new:', + FullConstructor.construct_python_object_new) + +class UnsafeConstructor(FullConstructor): + + def find_python_module(self, name, mark): + return super(UnsafeConstructor, self).find_python_module(name, mark, unsafe=True) + + def find_python_name(self, name, mark): + return super(UnsafeConstructor, self).find_python_name(name, mark, unsafe=True) + + def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False): + return super(UnsafeConstructor, self).make_python_instance( + suffix, node, args, kwds, newobj, unsafe=True) + +UnsafeConstructor.add_multi_constructor( + 'tag:yaml.org,2002:python/object/apply:', + UnsafeConstructor.construct_python_object_apply) + +# Constructor is same as UnsafeConstructor. Need to leave this in place in case +# people have extended it directly. +class Constructor(UnsafeConstructor): + pass diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/cyaml.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/cyaml.py new file mode 100644 index 00000000..1e606c74 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/cyaml.py @@ -0,0 +1,101 @@ + +__all__ = [ + 'CBaseLoader', 'CSafeLoader', 'CFullLoader', 'CUnsafeLoader', 'CLoader', + 'CBaseDumper', 'CSafeDumper', 'CDumper' +] + +from _yaml import CParser, CEmitter + +from .constructor import * + +from .serializer import * +from .representer import * + +from .resolver import * + +class CBaseLoader(CParser, BaseConstructor, BaseResolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class CSafeLoader(CParser, SafeConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class CFullLoader(CParser, FullConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class CUnsafeLoader(CParser, UnsafeConstructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + UnsafeConstructor.__init__(self) + Resolver.__init__(self) + +class CLoader(CParser, Constructor, Resolver): + + def __init__(self, stream): + CParser.__init__(self, stream) + Constructor.__init__(self) + Resolver.__init__(self) + +class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class CSafeDumper(CEmitter, SafeRepresenter, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + SafeRepresenter.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class CDumper(CEmitter, Serializer, Representer, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + CEmitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, encoding=encoding, + allow_unicode=allow_unicode, line_break=line_break, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/dumper.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/dumper.py new file mode 100644 index 00000000..6aadba55 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/dumper.py @@ -0,0 +1,62 @@ + +__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] + +from .emitter import * +from .serializer import * +from .representer import * +from .resolver import * + +class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + SafeRepresenter.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + +class Dumper(Emitter, Serializer, Representer, Resolver): + + def __init__(self, stream, + default_style=None, default_flow_style=False, + canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None, + encoding=None, explicit_start=None, explicit_end=None, + version=None, tags=None, sort_keys=True): + Emitter.__init__(self, stream, canonical=canonical, + indent=indent, width=width, + allow_unicode=allow_unicode, line_break=line_break) + Serializer.__init__(self, encoding=encoding, + explicit_start=explicit_start, explicit_end=explicit_end, + version=version, tags=tags) + Representer.__init__(self, default_style=default_style, + default_flow_style=default_flow_style, sort_keys=sort_keys) + Resolver.__init__(self) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/emitter.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/emitter.py new file mode 100644 index 00000000..a664d011 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/emitter.py @@ -0,0 +1,1137 @@ + +# Emitter expects events obeying the following grammar: +# stream ::= STREAM-START document* STREAM-END +# document ::= DOCUMENT-START node DOCUMENT-END +# node ::= SCALAR | sequence | mapping +# sequence ::= SEQUENCE-START node* SEQUENCE-END +# mapping ::= MAPPING-START (node node)* MAPPING-END + +__all__ = ['Emitter', 'EmitterError'] + +from .error import YAMLError +from .events import * + +class EmitterError(YAMLError): + pass + +class ScalarAnalysis: + def __init__(self, scalar, empty, multiline, + allow_flow_plain, allow_block_plain, + allow_single_quoted, allow_double_quoted, + allow_block): + self.scalar = scalar + self.empty = empty + self.multiline = multiline + self.allow_flow_plain = allow_flow_plain + self.allow_block_plain = allow_block_plain + self.allow_single_quoted = allow_single_quoted + self.allow_double_quoted = allow_double_quoted + self.allow_block = allow_block + +class Emitter: + + DEFAULT_TAG_PREFIXES = { + '!' : '!', + 'tag:yaml.org,2002:' : '!!', + } + + def __init__(self, stream, canonical=None, indent=None, width=None, + allow_unicode=None, line_break=None): + + # The stream should have the methods `write` and possibly `flush`. + self.stream = stream + + # Encoding can be overridden by STREAM-START. + self.encoding = None + + # Emitter is a state machine with a stack of states to handle nested + # structures. + self.states = [] + self.state = self.expect_stream_start + + # Current event and the event queue. + self.events = [] + self.event = None + + # The current indentation level and the stack of previous indents. + self.indents = [] + self.indent = None + + # Flow level. + self.flow_level = 0 + + # Contexts. + self.root_context = False + self.sequence_context = False + self.mapping_context = False + self.simple_key_context = False + + # Characteristics of the last emitted character: + # - current position. + # - is it a whitespace? + # - is it an indention character + # (indentation space, '-', '?', or ':')? + self.line = 0 + self.column = 0 + self.whitespace = True + self.indention = True + + # Whether the document requires an explicit document indicator + self.open_ended = False + + # Formatting details. + self.canonical = canonical + self.allow_unicode = allow_unicode + self.best_indent = 2 + if indent and 1 < indent < 10: + self.best_indent = indent + self.best_width = 80 + if width and width > self.best_indent*2: + self.best_width = width + self.best_line_break = '\n' + if line_break in ['\r', '\n', '\r\n']: + self.best_line_break = line_break + + # Tag prefixes. + self.tag_prefixes = None + + # Prepared anchor and tag. + self.prepared_anchor = None + self.prepared_tag = None + + # Scalar analysis and style. + self.analysis = None + self.style = None + + def dispose(self): + # Reset the state attributes (to clear self-references) + self.states = [] + self.state = None + + def emit(self, event): + self.events.append(event) + while not self.need_more_events(): + self.event = self.events.pop(0) + self.state() + self.event = None + + # In some cases, we wait for a few next events before emitting. + + def need_more_events(self): + if not self.events: + return True + event = self.events[0] + if isinstance(event, DocumentStartEvent): + return self.need_events(1) + elif isinstance(event, SequenceStartEvent): + return self.need_events(2) + elif isinstance(event, MappingStartEvent): + return self.need_events(3) + else: + return False + + def need_events(self, count): + level = 0 + for event in self.events[1:]: + if isinstance(event, (DocumentStartEvent, CollectionStartEvent)): + level += 1 + elif isinstance(event, (DocumentEndEvent, CollectionEndEvent)): + level -= 1 + elif isinstance(event, StreamEndEvent): + level = -1 + if level < 0: + return False + return (len(self.events) < count+1) + + def increase_indent(self, flow=False, indentless=False): + self.indents.append(self.indent) + if self.indent is None: + if flow: + self.indent = self.best_indent + else: + self.indent = 0 + elif not indentless: + self.indent += self.best_indent + + # States. + + # Stream handlers. + + def expect_stream_start(self): + if isinstance(self.event, StreamStartEvent): + if self.event.encoding and not hasattr(self.stream, 'encoding'): + self.encoding = self.event.encoding + self.write_stream_start() + self.state = self.expect_first_document_start + else: + raise EmitterError("expected StreamStartEvent, but got %s" + % self.event) + + def expect_nothing(self): + raise EmitterError("expected nothing, but got %s" % self.event) + + # Document handlers. + + def expect_first_document_start(self): + return self.expect_document_start(first=True) + + def expect_document_start(self, first=False): + if isinstance(self.event, DocumentStartEvent): + if (self.event.version or self.event.tags) and self.open_ended: + self.write_indicator('...', True) + self.write_indent() + if self.event.version: + version_text = self.prepare_version(self.event.version) + self.write_version_directive(version_text) + self.tag_prefixes = self.DEFAULT_TAG_PREFIXES.copy() + if self.event.tags: + handles = sorted(self.event.tags.keys()) + for handle in handles: + prefix = self.event.tags[handle] + self.tag_prefixes[prefix] = handle + handle_text = self.prepare_tag_handle(handle) + prefix_text = self.prepare_tag_prefix(prefix) + self.write_tag_directive(handle_text, prefix_text) + implicit = (first and not self.event.explicit and not self.canonical + and not self.event.version and not self.event.tags + and not self.check_empty_document()) + if not implicit: + self.write_indent() + self.write_indicator('---', True) + if self.canonical: + self.write_indent() + self.state = self.expect_document_root + elif isinstance(self.event, StreamEndEvent): + if self.open_ended: + self.write_indicator('...', True) + self.write_indent() + self.write_stream_end() + self.state = self.expect_nothing + else: + raise EmitterError("expected DocumentStartEvent, but got %s" + % self.event) + + def expect_document_end(self): + if isinstance(self.event, DocumentEndEvent): + self.write_indent() + if self.event.explicit: + self.write_indicator('...', True) + self.write_indent() + self.flush_stream() + self.state = self.expect_document_start + else: + raise EmitterError("expected DocumentEndEvent, but got %s" + % self.event) + + def expect_document_root(self): + self.states.append(self.expect_document_end) + self.expect_node(root=True) + + # Node handlers. + + def expect_node(self, root=False, sequence=False, mapping=False, + simple_key=False): + self.root_context = root + self.sequence_context = sequence + self.mapping_context = mapping + self.simple_key_context = simple_key + if isinstance(self.event, AliasEvent): + self.expect_alias() + elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)): + self.process_anchor('&') + self.process_tag() + if isinstance(self.event, ScalarEvent): + self.expect_scalar() + elif isinstance(self.event, SequenceStartEvent): + if self.flow_level or self.canonical or self.event.flow_style \ + or self.check_empty_sequence(): + self.expect_flow_sequence() + else: + self.expect_block_sequence() + elif isinstance(self.event, MappingStartEvent): + if self.flow_level or self.canonical or self.event.flow_style \ + or self.check_empty_mapping(): + self.expect_flow_mapping() + else: + self.expect_block_mapping() + else: + raise EmitterError("expected NodeEvent, but got %s" % self.event) + + def expect_alias(self): + if self.event.anchor is None: + raise EmitterError("anchor is not specified for alias") + self.process_anchor('*') + self.state = self.states.pop() + + def expect_scalar(self): + self.increase_indent(flow=True) + self.process_scalar() + self.indent = self.indents.pop() + self.state = self.states.pop() + + # Flow sequence handlers. + + def expect_flow_sequence(self): + self.write_indicator('[', True, whitespace=True) + self.flow_level += 1 + self.increase_indent(flow=True) + self.state = self.expect_first_flow_sequence_item + + def expect_first_flow_sequence_item(self): + if isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + self.write_indicator(']', False) + self.state = self.states.pop() + else: + if self.canonical or self.column > self.best_width: + self.write_indent() + self.states.append(self.expect_flow_sequence_item) + self.expect_node(sequence=True) + + def expect_flow_sequence_item(self): + if isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + if self.canonical: + self.write_indicator(',', False) + self.write_indent() + self.write_indicator(']', False) + self.state = self.states.pop() + else: + self.write_indicator(',', False) + if self.canonical or self.column > self.best_width: + self.write_indent() + self.states.append(self.expect_flow_sequence_item) + self.expect_node(sequence=True) + + # Flow mapping handlers. + + def expect_flow_mapping(self): + self.write_indicator('{', True, whitespace=True) + self.flow_level += 1 + self.increase_indent(flow=True) + self.state = self.expect_first_flow_mapping_key + + def expect_first_flow_mapping_key(self): + if isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + self.write_indicator('}', False) + self.state = self.states.pop() + else: + if self.canonical or self.column > self.best_width: + self.write_indent() + if not self.canonical and self.check_simple_key(): + self.states.append(self.expect_flow_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True) + self.states.append(self.expect_flow_mapping_value) + self.expect_node(mapping=True) + + def expect_flow_mapping_key(self): + if isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.flow_level -= 1 + if self.canonical: + self.write_indicator(',', False) + self.write_indent() + self.write_indicator('}', False) + self.state = self.states.pop() + else: + self.write_indicator(',', False) + if self.canonical or self.column > self.best_width: + self.write_indent() + if not self.canonical and self.check_simple_key(): + self.states.append(self.expect_flow_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True) + self.states.append(self.expect_flow_mapping_value) + self.expect_node(mapping=True) + + def expect_flow_mapping_simple_value(self): + self.write_indicator(':', False) + self.states.append(self.expect_flow_mapping_key) + self.expect_node(mapping=True) + + def expect_flow_mapping_value(self): + if self.canonical or self.column > self.best_width: + self.write_indent() + self.write_indicator(':', True) + self.states.append(self.expect_flow_mapping_key) + self.expect_node(mapping=True) + + # Block sequence handlers. + + def expect_block_sequence(self): + indentless = (self.mapping_context and not self.indention) + self.increase_indent(flow=False, indentless=indentless) + self.state = self.expect_first_block_sequence_item + + def expect_first_block_sequence_item(self): + return self.expect_block_sequence_item(first=True) + + def expect_block_sequence_item(self, first=False): + if not first and isinstance(self.event, SequenceEndEvent): + self.indent = self.indents.pop() + self.state = self.states.pop() + else: + self.write_indent() + self.write_indicator('-', True, indention=True) + self.states.append(self.expect_block_sequence_item) + self.expect_node(sequence=True) + + # Block mapping handlers. + + def expect_block_mapping(self): + self.increase_indent(flow=False) + self.state = self.expect_first_block_mapping_key + + def expect_first_block_mapping_key(self): + return self.expect_block_mapping_key(first=True) + + def expect_block_mapping_key(self, first=False): + if not first and isinstance(self.event, MappingEndEvent): + self.indent = self.indents.pop() + self.state = self.states.pop() + else: + self.write_indent() + if self.check_simple_key(): + self.states.append(self.expect_block_mapping_simple_value) + self.expect_node(mapping=True, simple_key=True) + else: + self.write_indicator('?', True, indention=True) + self.states.append(self.expect_block_mapping_value) + self.expect_node(mapping=True) + + def expect_block_mapping_simple_value(self): + self.write_indicator(':', False) + self.states.append(self.expect_block_mapping_key) + self.expect_node(mapping=True) + + def expect_block_mapping_value(self): + self.write_indent() + self.write_indicator(':', True, indention=True) + self.states.append(self.expect_block_mapping_key) + self.expect_node(mapping=True) + + # Checkers. + + def check_empty_sequence(self): + return (isinstance(self.event, SequenceStartEvent) and self.events + and isinstance(self.events[0], SequenceEndEvent)) + + def check_empty_mapping(self): + return (isinstance(self.event, MappingStartEvent) and self.events + and isinstance(self.events[0], MappingEndEvent)) + + def check_empty_document(self): + if not isinstance(self.event, DocumentStartEvent) or not self.events: + return False + event = self.events[0] + return (isinstance(event, ScalarEvent) and event.anchor is None + and event.tag is None and event.implicit and event.value == '') + + def check_simple_key(self): + length = 0 + if isinstance(self.event, NodeEvent) and self.event.anchor is not None: + if self.prepared_anchor is None: + self.prepared_anchor = self.prepare_anchor(self.event.anchor) + length += len(self.prepared_anchor) + if isinstance(self.event, (ScalarEvent, CollectionStartEvent)) \ + and self.event.tag is not None: + if self.prepared_tag is None: + self.prepared_tag = self.prepare_tag(self.event.tag) + length += len(self.prepared_tag) + if isinstance(self.event, ScalarEvent): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + length += len(self.analysis.scalar) + return (length < 128 and (isinstance(self.event, AliasEvent) + or (isinstance(self.event, ScalarEvent) + and not self.analysis.empty and not self.analysis.multiline) + or self.check_empty_sequence() or self.check_empty_mapping())) + + # Anchor, Tag, and Scalar processors. + + def process_anchor(self, indicator): + if self.event.anchor is None: + self.prepared_anchor = None + return + if self.prepared_anchor is None: + self.prepared_anchor = self.prepare_anchor(self.event.anchor) + if self.prepared_anchor: + self.write_indicator(indicator+self.prepared_anchor, True) + self.prepared_anchor = None + + def process_tag(self): + tag = self.event.tag + if isinstance(self.event, ScalarEvent): + if self.style is None: + self.style = self.choose_scalar_style() + if ((not self.canonical or tag is None) and + ((self.style == '' and self.event.implicit[0]) + or (self.style != '' and self.event.implicit[1]))): + self.prepared_tag = None + return + if self.event.implicit[0] and tag is None: + tag = '!' + self.prepared_tag = None + else: + if (not self.canonical or tag is None) and self.event.implicit: + self.prepared_tag = None + return + if tag is None: + raise EmitterError("tag is not specified") + if self.prepared_tag is None: + self.prepared_tag = self.prepare_tag(tag) + if self.prepared_tag: + self.write_indicator(self.prepared_tag, True) + self.prepared_tag = None + + def choose_scalar_style(self): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + if self.event.style == '"' or self.canonical: + return '"' + if not self.event.style and self.event.implicit[0]: + if (not (self.simple_key_context and + (self.analysis.empty or self.analysis.multiline)) + and (self.flow_level and self.analysis.allow_flow_plain + or (not self.flow_level and self.analysis.allow_block_plain))): + return '' + if self.event.style and self.event.style in '|>': + if (not self.flow_level and not self.simple_key_context + and self.analysis.allow_block): + return self.event.style + if not self.event.style or self.event.style == '\'': + if (self.analysis.allow_single_quoted and + not (self.simple_key_context and self.analysis.multiline)): + return '\'' + return '"' + + def process_scalar(self): + if self.analysis is None: + self.analysis = self.analyze_scalar(self.event.value) + if self.style is None: + self.style = self.choose_scalar_style() + split = (not self.simple_key_context) + #if self.analysis.multiline and split \ + # and (not self.style or self.style in '\'\"'): + # self.write_indent() + if self.style == '"': + self.write_double_quoted(self.analysis.scalar, split) + elif self.style == '\'': + self.write_single_quoted(self.analysis.scalar, split) + elif self.style == '>': + self.write_folded(self.analysis.scalar) + elif self.style == '|': + self.write_literal(self.analysis.scalar) + else: + self.write_plain(self.analysis.scalar, split) + self.analysis = None + self.style = None + + # Analyzers. + + def prepare_version(self, version): + major, minor = version + if major != 1: + raise EmitterError("unsupported YAML version: %d.%d" % (major, minor)) + return '%d.%d' % (major, minor) + + def prepare_tag_handle(self, handle): + if not handle: + raise EmitterError("tag handle must not be empty") + if handle[0] != '!' or handle[-1] != '!': + raise EmitterError("tag handle must start and end with '!': %r" % handle) + for ch in handle[1:-1]: + if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_'): + raise EmitterError("invalid character %r in the tag handle: %r" + % (ch, handle)) + return handle + + def prepare_tag_prefix(self, prefix): + if not prefix: + raise EmitterError("tag prefix must not be empty") + chunks = [] + start = end = 0 + if prefix[0] == '!': + end = 1 + while end < len(prefix): + ch = prefix[end] + if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?!:@&=+$,_.~*\'()[]': + end += 1 + else: + if start < end: + chunks.append(prefix[start:end]) + start = end = end+1 + data = ch.encode('utf-8') + for ch in data: + chunks.append('%%%02X' % ord(ch)) + if start < end: + chunks.append(prefix[start:end]) + return ''.join(chunks) + + def prepare_tag(self, tag): + if not tag: + raise EmitterError("tag must not be empty") + if tag == '!': + return tag + handle = None + suffix = tag + prefixes = sorted(self.tag_prefixes.keys()) + for prefix in prefixes: + if tag.startswith(prefix) \ + and (prefix == '!' or len(prefix) < len(tag)): + handle = self.tag_prefixes[prefix] + suffix = tag[len(prefix):] + chunks = [] + start = end = 0 + while end < len(suffix): + ch = suffix[end] + if '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?:@&=+$,_.~*\'()[]' \ + or (ch == '!' and handle != '!'): + end += 1 + else: + if start < end: + chunks.append(suffix[start:end]) + start = end = end+1 + data = ch.encode('utf-8') + for ch in data: + chunks.append('%%%02X' % ch) + if start < end: + chunks.append(suffix[start:end]) + suffix_text = ''.join(chunks) + if handle: + return '%s%s' % (handle, suffix_text) + else: + return '!<%s>' % suffix_text + + def prepare_anchor(self, anchor): + if not anchor: + raise EmitterError("anchor must not be empty") + for ch in anchor: + if not ('0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_'): + raise EmitterError("invalid character %r in the anchor: %r" + % (ch, anchor)) + return anchor + + def analyze_scalar(self, scalar): + + # Empty scalar is a special case. + if not scalar: + return ScalarAnalysis(scalar=scalar, empty=True, multiline=False, + allow_flow_plain=False, allow_block_plain=True, + allow_single_quoted=True, allow_double_quoted=True, + allow_block=False) + + # Indicators and special characters. + block_indicators = False + flow_indicators = False + line_breaks = False + special_characters = False + + # Important whitespace combinations. + leading_space = False + leading_break = False + trailing_space = False + trailing_break = False + break_space = False + space_break = False + + # Check document indicators. + if scalar.startswith('---') or scalar.startswith('...'): + block_indicators = True + flow_indicators = True + + # First character or preceded by a whitespace. + preceded_by_whitespace = True + + # Last character or followed by a whitespace. + followed_by_whitespace = (len(scalar) == 1 or + scalar[1] in '\0 \t\r\n\x85\u2028\u2029') + + # The previous character is a space. + previous_space = False + + # The previous character is a break. + previous_break = False + + index = 0 + while index < len(scalar): + ch = scalar[index] + + # Check for indicators. + if index == 0: + # Leading indicators are special characters. + if ch in '#,[]{}&*!|>\'\"%@`': + flow_indicators = True + block_indicators = True + if ch in '?:': + flow_indicators = True + if followed_by_whitespace: + block_indicators = True + if ch == '-' and followed_by_whitespace: + flow_indicators = True + block_indicators = True + else: + # Some indicators cannot appear within a scalar as well. + if ch in ',?[]{}': + flow_indicators = True + if ch == ':': + flow_indicators = True + if followed_by_whitespace: + block_indicators = True + if ch == '#' and preceded_by_whitespace: + flow_indicators = True + block_indicators = True + + # Check for line breaks, special, and unicode characters. + if ch in '\n\x85\u2028\u2029': + line_breaks = True + if not (ch == '\n' or '\x20' <= ch <= '\x7E'): + if (ch == '\x85' or '\xA0' <= ch <= '\uD7FF' + or '\uE000' <= ch <= '\uFFFD' + or '\U00010000' <= ch < '\U0010ffff') and ch != '\uFEFF': + unicode_characters = True + if not self.allow_unicode: + special_characters = True + else: + special_characters = True + + # Detect important whitespace combinations. + if ch == ' ': + if index == 0: + leading_space = True + if index == len(scalar)-1: + trailing_space = True + if previous_break: + break_space = True + previous_space = True + previous_break = False + elif ch in '\n\x85\u2028\u2029': + if index == 0: + leading_break = True + if index == len(scalar)-1: + trailing_break = True + if previous_space: + space_break = True + previous_space = False + previous_break = True + else: + previous_space = False + previous_break = False + + # Prepare for the next character. + index += 1 + preceded_by_whitespace = (ch in '\0 \t\r\n\x85\u2028\u2029') + followed_by_whitespace = (index+1 >= len(scalar) or + scalar[index+1] in '\0 \t\r\n\x85\u2028\u2029') + + # Let's decide what styles are allowed. + allow_flow_plain = True + allow_block_plain = True + allow_single_quoted = True + allow_double_quoted = True + allow_block = True + + # Leading and trailing whitespaces are bad for plain scalars. + if (leading_space or leading_break + or trailing_space or trailing_break): + allow_flow_plain = allow_block_plain = False + + # We do not permit trailing spaces for block scalars. + if trailing_space: + allow_block = False + + # Spaces at the beginning of a new line are only acceptable for block + # scalars. + if break_space: + allow_flow_plain = allow_block_plain = allow_single_quoted = False + + # Spaces followed by breaks, as well as special character are only + # allowed for double quoted scalars. + if space_break or special_characters: + allow_flow_plain = allow_block_plain = \ + allow_single_quoted = allow_block = False + + # Although the plain scalar writer supports breaks, we never emit + # multiline plain scalars. + if line_breaks: + allow_flow_plain = allow_block_plain = False + + # Flow indicators are forbidden for flow plain scalars. + if flow_indicators: + allow_flow_plain = False + + # Block indicators are forbidden for block plain scalars. + if block_indicators: + allow_block_plain = False + + return ScalarAnalysis(scalar=scalar, + empty=False, multiline=line_breaks, + allow_flow_plain=allow_flow_plain, + allow_block_plain=allow_block_plain, + allow_single_quoted=allow_single_quoted, + allow_double_quoted=allow_double_quoted, + allow_block=allow_block) + + # Writers. + + def flush_stream(self): + if hasattr(self.stream, 'flush'): + self.stream.flush() + + def write_stream_start(self): + # Write BOM if needed. + if self.encoding and self.encoding.startswith('utf-16'): + self.stream.write('\uFEFF'.encode(self.encoding)) + + def write_stream_end(self): + self.flush_stream() + + def write_indicator(self, indicator, need_whitespace, + whitespace=False, indention=False): + if self.whitespace or not need_whitespace: + data = indicator + else: + data = ' '+indicator + self.whitespace = whitespace + self.indention = self.indention and indention + self.column += len(data) + self.open_ended = False + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_indent(self): + indent = self.indent or 0 + if not self.indention or self.column > indent \ + or (self.column == indent and not self.whitespace): + self.write_line_break() + if self.column < indent: + self.whitespace = True + data = ' '*(indent-self.column) + self.column = indent + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_line_break(self, data=None): + if data is None: + data = self.best_line_break + self.whitespace = True + self.indention = True + self.line += 1 + self.column = 0 + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + + def write_version_directive(self, version_text): + data = '%%YAML %s' % version_text + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_line_break() + + def write_tag_directive(self, handle_text, prefix_text): + data = '%%TAG %s %s' % (handle_text, prefix_text) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_line_break() + + # Scalar streams. + + def write_single_quoted(self, text, split=True): + self.write_indicator('\'', True) + spaces = False + breaks = False + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if spaces: + if ch is None or ch != ' ': + if start+1 == end and self.column > self.best_width and split \ + and start != 0 and end != len(text): + self.write_indent() + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + elif breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + if text[start] == '\n': + self.write_line_break() + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + self.write_indent() + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029' or ch == '\'': + if start < end: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch == '\'': + data = '\'\'' + self.column += 2 + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + 1 + if ch is not None: + spaces = (ch == ' ') + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 + self.write_indicator('\'', False) + + ESCAPE_REPLACEMENTS = { + '\0': '0', + '\x07': 'a', + '\x08': 'b', + '\x09': 't', + '\x0A': 'n', + '\x0B': 'v', + '\x0C': 'f', + '\x0D': 'r', + '\x1B': 'e', + '\"': '\"', + '\\': '\\', + '\x85': 'N', + '\xA0': '_', + '\u2028': 'L', + '\u2029': 'P', + } + + def write_double_quoted(self, text, split=True): + self.write_indicator('"', True) + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if ch is None or ch in '"\\\x85\u2028\u2029\uFEFF' \ + or not ('\x20' <= ch <= '\x7E' + or (self.allow_unicode + and ('\xA0' <= ch <= '\uD7FF' + or '\uE000' <= ch <= '\uFFFD'))): + if start < end: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch is not None: + if ch in self.ESCAPE_REPLACEMENTS: + data = '\\'+self.ESCAPE_REPLACEMENTS[ch] + elif ch <= '\xFF': + data = '\\x%02X' % ord(ch) + elif ch <= '\uFFFF': + data = '\\u%04X' % ord(ch) + else: + data = '\\U%08X' % ord(ch) + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end+1 + if 0 < end < len(text)-1 and (ch == ' ' or start >= end) \ + and self.column+(end-start) > self.best_width and split: + data = text[start:end]+'\\' + if start < end: + start = end + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.write_indent() + self.whitespace = False + self.indention = False + if text[start] == ' ': + data = '\\' + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + end += 1 + self.write_indicator('"', False) + + def determine_block_hints(self, text): + hints = '' + if text: + if text[0] in ' \n\x85\u2028\u2029': + hints += str(self.best_indent) + if text[-1] not in '\n\x85\u2028\u2029': + hints += '-' + elif len(text) == 1 or text[-2] in '\n\x85\u2028\u2029': + hints += '+' + return hints + + def write_folded(self, text): + hints = self.determine_block_hints(text) + self.write_indicator('>'+hints, True) + if hints[-1:] == '+': + self.open_ended = True + self.write_line_break() + leading_space = True + spaces = False + breaks = True + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + if not leading_space and ch is not None and ch != ' ' \ + and text[start] == '\n': + self.write_line_break() + leading_space = (ch == ' ') + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + if ch is not None: + self.write_indent() + start = end + elif spaces: + if ch != ' ': + if start+1 == end and self.column > self.best_width: + self.write_indent() + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029': + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + if ch is None: + self.write_line_break() + start = end + if ch is not None: + breaks = (ch in '\n\x85\u2028\u2029') + spaces = (ch == ' ') + end += 1 + + def write_literal(self, text): + hints = self.determine_block_hints(text) + self.write_indicator('|'+hints, True) + if hints[-1:] == '+': + self.open_ended = True + self.write_line_break() + breaks = True + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if breaks: + if ch is None or ch not in '\n\x85\u2028\u2029': + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + if ch is not None: + self.write_indent() + start = end + else: + if ch is None or ch in '\n\x85\u2028\u2029': + data = text[start:end] + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + if ch is None: + self.write_line_break() + start = end + if ch is not None: + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 + + def write_plain(self, text, split=True): + if self.root_context: + self.open_ended = True + if not text: + return + if not self.whitespace: + data = ' ' + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + self.whitespace = False + self.indention = False + spaces = False + breaks = False + start = end = 0 + while end <= len(text): + ch = None + if end < len(text): + ch = text[end] + if spaces: + if ch != ' ': + if start+1 == end and self.column > self.best_width and split: + self.write_indent() + self.whitespace = False + self.indention = False + else: + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + elif breaks: + if ch not in '\n\x85\u2028\u2029': + if text[start] == '\n': + self.write_line_break() + for br in text[start:end]: + if br == '\n': + self.write_line_break() + else: + self.write_line_break(br) + self.write_indent() + self.whitespace = False + self.indention = False + start = end + else: + if ch is None or ch in ' \n\x85\u2028\u2029': + data = text[start:end] + self.column += len(data) + if self.encoding: + data = data.encode(self.encoding) + self.stream.write(data) + start = end + if ch is not None: + spaces = (ch == ' ') + breaks = (ch in '\n\x85\u2028\u2029') + end += 1 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/error.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/error.py new file mode 100644 index 00000000..b796b4dc --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/error.py @@ -0,0 +1,75 @@ + +__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] + +class Mark: + + def __init__(self, name, index, line, column, buffer, pointer): + self.name = name + self.index = index + self.line = line + self.column = column + self.buffer = buffer + self.pointer = pointer + + def get_snippet(self, indent=4, max_length=75): + if self.buffer is None: + return None + head = '' + start = self.pointer + while start > 0 and self.buffer[start-1] not in '\0\r\n\x85\u2028\u2029': + start -= 1 + if self.pointer-start > max_length/2-1: + head = ' ... ' + start += 5 + break + tail = '' + end = self.pointer + while end < len(self.buffer) and self.buffer[end] not in '\0\r\n\x85\u2028\u2029': + end += 1 + if end-self.pointer > max_length/2-1: + tail = ' ... ' + end -= 5 + break + snippet = self.buffer[start:end] + return ' '*indent + head + snippet + tail + '\n' \ + + ' '*(indent+self.pointer-start+len(head)) + '^' + + def __str__(self): + snippet = self.get_snippet() + where = " in \"%s\", line %d, column %d" \ + % (self.name, self.line+1, self.column+1) + if snippet is not None: + where += ":\n"+snippet + return where + +class YAMLError(Exception): + pass + +class MarkedYAMLError(YAMLError): + + def __init__(self, context=None, context_mark=None, + problem=None, problem_mark=None, note=None): + self.context = context + self.context_mark = context_mark + self.problem = problem + self.problem_mark = problem_mark + self.note = note + + def __str__(self): + lines = [] + if self.context is not None: + lines.append(self.context) + if self.context_mark is not None \ + and (self.problem is None or self.problem_mark is None + or self.context_mark.name != self.problem_mark.name + or self.context_mark.line != self.problem_mark.line + or self.context_mark.column != self.problem_mark.column): + lines.append(str(self.context_mark)) + if self.problem is not None: + lines.append(self.problem) + if self.problem_mark is not None: + lines.append(str(self.problem_mark)) + if self.note is not None: + lines.append(self.note) + return '\n'.join(lines) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/events.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/events.py new file mode 100644 index 00000000..f79ad389 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/events.py @@ -0,0 +1,86 @@ + +# Abstract classes. + +class Event(object): + def __init__(self, start_mark=None, end_mark=None): + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] + if hasattr(self, key)] + arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) + for key in attributes]) + return '%s(%s)' % (self.__class__.__name__, arguments) + +class NodeEvent(Event): + def __init__(self, anchor, start_mark=None, end_mark=None): + self.anchor = anchor + self.start_mark = start_mark + self.end_mark = end_mark + +class CollectionStartEvent(NodeEvent): + def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None, + flow_style=None): + self.anchor = anchor + self.tag = tag + self.implicit = implicit + self.start_mark = start_mark + self.end_mark = end_mark + self.flow_style = flow_style + +class CollectionEndEvent(Event): + pass + +# Implementations. + +class StreamStartEvent(Event): + def __init__(self, start_mark=None, end_mark=None, encoding=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.encoding = encoding + +class StreamEndEvent(Event): + pass + +class DocumentStartEvent(Event): + def __init__(self, start_mark=None, end_mark=None, + explicit=None, version=None, tags=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.explicit = explicit + self.version = version + self.tags = tags + +class DocumentEndEvent(Event): + def __init__(self, start_mark=None, end_mark=None, + explicit=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.explicit = explicit + +class AliasEvent(NodeEvent): + pass + +class ScalarEvent(NodeEvent): + def __init__(self, anchor, tag, implicit, value, + start_mark=None, end_mark=None, style=None): + self.anchor = anchor + self.tag = tag + self.implicit = implicit + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + +class SequenceStartEvent(CollectionStartEvent): + pass + +class SequenceEndEvent(CollectionEndEvent): + pass + +class MappingStartEvent(CollectionStartEvent): + pass + +class MappingEndEvent(CollectionEndEvent): + pass + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/loader.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/loader.py new file mode 100644 index 00000000..e90c1122 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/loader.py @@ -0,0 +1,63 @@ + +__all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader'] + +from .reader import * +from .scanner import * +from .parser import * +from .composer import * +from .constructor import * +from .resolver import * + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + BaseConstructor.__init__(self) + BaseResolver.__init__(self) + +class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + FullConstructor.__init__(self) + Resolver.__init__(self) + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + SafeConstructor.__init__(self) + Resolver.__init__(self) + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) + +# UnsafeLoader is the same as Loader (which is and was always unsafe on +# untrusted input). Use of either Loader or UnsafeLoader should be rare, since +# FullLoad should be able to load almost all YAML safely. Loader is left intact +# to ensure backwards compatibility. +class UnsafeLoader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + + def __init__(self, stream): + Reader.__init__(self, stream) + Scanner.__init__(self) + Parser.__init__(self) + Composer.__init__(self) + Constructor.__init__(self) + Resolver.__init__(self) diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/nodes.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/nodes.py new file mode 100644 index 00000000..c4f070c4 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/nodes.py @@ -0,0 +1,49 @@ + +class Node(object): + def __init__(self, tag, value, start_mark, end_mark): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + value = self.value + #if isinstance(value, list): + # if len(value) == 0: + # value = '' + # elif len(value) == 1: + # value = '<1 item>' + # else: + # value = '<%d items>' % len(value) + #else: + # if len(value) > 75: + # value = repr(value[:70]+u' ... ') + # else: + # value = repr(value) + value = repr(value) + return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value) + +class ScalarNode(Node): + id = 'scalar' + def __init__(self, tag, value, + start_mark=None, end_mark=None, style=None): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + +class CollectionNode(Node): + def __init__(self, tag, value, + start_mark=None, end_mark=None, flow_style=None): + self.tag = tag + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + self.flow_style = flow_style + +class SequenceNode(CollectionNode): + id = 'sequence' + +class MappingNode(CollectionNode): + id = 'mapping' + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/parser.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/parser.py new file mode 100644 index 00000000..13a5995d --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/parser.py @@ -0,0 +1,589 @@ + +# The following YAML grammar is LL(1) and is parsed by a recursive descent +# parser. +# +# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END +# implicit_document ::= block_node DOCUMENT-END* +# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +# block_node_or_indentless_sequence ::= +# ALIAS +# | properties (block_content | indentless_block_sequence)? +# | block_content +# | indentless_block_sequence +# block_node ::= ALIAS +# | properties block_content? +# | block_content +# flow_node ::= ALIAS +# | properties flow_content? +# | flow_content +# properties ::= TAG ANCHOR? | ANCHOR TAG? +# block_content ::= block_collection | flow_collection | SCALAR +# flow_content ::= flow_collection | SCALAR +# block_collection ::= block_sequence | block_mapping +# flow_collection ::= flow_sequence | flow_mapping +# block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END +# indentless_sequence ::= (BLOCK-ENTRY block_node?)+ +# block_mapping ::= BLOCK-MAPPING_START +# ((KEY block_node_or_indentless_sequence?)? +# (VALUE block_node_or_indentless_sequence?)?)* +# BLOCK-END +# flow_sequence ::= FLOW-SEQUENCE-START +# (flow_sequence_entry FLOW-ENTRY)* +# flow_sequence_entry? +# FLOW-SEQUENCE-END +# flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +# flow_mapping ::= FLOW-MAPPING-START +# (flow_mapping_entry FLOW-ENTRY)* +# flow_mapping_entry? +# FLOW-MAPPING-END +# flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +# +# FIRST sets: +# +# stream: { STREAM-START } +# explicit_document: { DIRECTIVE DOCUMENT-START } +# implicit_document: FIRST(block_node) +# block_node: { ALIAS TAG ANCHOR SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START } +# flow_node: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START } +# block_content: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR } +# flow_content: { FLOW-SEQUENCE-START FLOW-MAPPING-START SCALAR } +# block_collection: { BLOCK-SEQUENCE-START BLOCK-MAPPING-START } +# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START } +# block_sequence: { BLOCK-SEQUENCE-START } +# block_mapping: { BLOCK-MAPPING-START } +# block_node_or_indentless_sequence: { ALIAS ANCHOR TAG SCALAR BLOCK-SEQUENCE-START BLOCK-MAPPING-START FLOW-SEQUENCE-START FLOW-MAPPING-START BLOCK-ENTRY } +# indentless_sequence: { ENTRY } +# flow_collection: { FLOW-SEQUENCE-START FLOW-MAPPING-START } +# flow_sequence: { FLOW-SEQUENCE-START } +# flow_mapping: { FLOW-MAPPING-START } +# flow_sequence_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY } +# flow_mapping_entry: { ALIAS ANCHOR TAG SCALAR FLOW-SEQUENCE-START FLOW-MAPPING-START KEY } + +__all__ = ['Parser', 'ParserError'] + +from .error import MarkedYAMLError +from .tokens import * +from .events import * +from .scanner import * + +class ParserError(MarkedYAMLError): + pass + +class Parser: + # Since writing a recursive-descendant parser is a straightforward task, we + # do not give many comments here. + + DEFAULT_TAGS = { + '!': '!', + '!!': 'tag:yaml.org,2002:', + } + + def __init__(self): + self.current_event = None + self.yaml_version = None + self.tag_handles = {} + self.states = [] + self.marks = [] + self.state = self.parse_stream_start + + def dispose(self): + # Reset the state attributes (to clear self-references) + self.states = [] + self.state = None + + def check_event(self, *choices): + # Check the type of the next event. + if self.current_event is None: + if self.state: + self.current_event = self.state() + if self.current_event is not None: + if not choices: + return True + for choice in choices: + if isinstance(self.current_event, choice): + return True + return False + + def peek_event(self): + # Get the next event. + if self.current_event is None: + if self.state: + self.current_event = self.state() + return self.current_event + + def get_event(self): + # Get the next event and proceed further. + if self.current_event is None: + if self.state: + self.current_event = self.state() + value = self.current_event + self.current_event = None + return value + + # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END + # implicit_document ::= block_node DOCUMENT-END* + # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* + + def parse_stream_start(self): + + # Parse the stream start. + token = self.get_token() + event = StreamStartEvent(token.start_mark, token.end_mark, + encoding=token.encoding) + + # Prepare the next state. + self.state = self.parse_implicit_document_start + + return event + + def parse_implicit_document_start(self): + + # Parse an implicit document. + if not self.check_token(DirectiveToken, DocumentStartToken, + StreamEndToken): + self.tag_handles = self.DEFAULT_TAGS + token = self.peek_token() + start_mark = end_mark = token.start_mark + event = DocumentStartEvent(start_mark, end_mark, + explicit=False) + + # Prepare the next state. + self.states.append(self.parse_document_end) + self.state = self.parse_block_node + + return event + + else: + return self.parse_document_start() + + def parse_document_start(self): + + # Parse any extra document end indicators. + while self.check_token(DocumentEndToken): + self.get_token() + + # Parse an explicit document. + if not self.check_token(StreamEndToken): + token = self.peek_token() + start_mark = token.start_mark + version, tags = self.process_directives() + if not self.check_token(DocumentStartToken): + raise ParserError(None, None, + "expected '', but found %r" + % self.peek_token().id, + self.peek_token().start_mark) + token = self.get_token() + end_mark = token.end_mark + event = DocumentStartEvent(start_mark, end_mark, + explicit=True, version=version, tags=tags) + self.states.append(self.parse_document_end) + self.state = self.parse_document_content + else: + # Parse the end of the stream. + token = self.get_token() + event = StreamEndEvent(token.start_mark, token.end_mark) + assert not self.states + assert not self.marks + self.state = None + return event + + def parse_document_end(self): + + # Parse the document end. + token = self.peek_token() + start_mark = end_mark = token.start_mark + explicit = False + if self.check_token(DocumentEndToken): + token = self.get_token() + end_mark = token.end_mark + explicit = True + event = DocumentEndEvent(start_mark, end_mark, + explicit=explicit) + + # Prepare the next state. + self.state = self.parse_document_start + + return event + + def parse_document_content(self): + if self.check_token(DirectiveToken, + DocumentStartToken, DocumentEndToken, StreamEndToken): + event = self.process_empty_scalar(self.peek_token().start_mark) + self.state = self.states.pop() + return event + else: + return self.parse_block_node() + + def process_directives(self): + self.yaml_version = None + self.tag_handles = {} + while self.check_token(DirectiveToken): + token = self.get_token() + if token.name == 'YAML': + if self.yaml_version is not None: + raise ParserError(None, None, + "found duplicate YAML directive", token.start_mark) + major, minor = token.value + if major != 1: + raise ParserError(None, None, + "found incompatible YAML document (version 1.* is required)", + token.start_mark) + self.yaml_version = token.value + elif token.name == 'TAG': + handle, prefix = token.value + if handle in self.tag_handles: + raise ParserError(None, None, + "duplicate tag handle %r" % handle, + token.start_mark) + self.tag_handles[handle] = prefix + if self.tag_handles: + value = self.yaml_version, self.tag_handles.copy() + else: + value = self.yaml_version, None + for key in self.DEFAULT_TAGS: + if key not in self.tag_handles: + self.tag_handles[key] = self.DEFAULT_TAGS[key] + return value + + # block_node_or_indentless_sequence ::= ALIAS + # | properties (block_content | indentless_block_sequence)? + # | block_content + # | indentless_block_sequence + # block_node ::= ALIAS + # | properties block_content? + # | block_content + # flow_node ::= ALIAS + # | properties flow_content? + # | flow_content + # properties ::= TAG ANCHOR? | ANCHOR TAG? + # block_content ::= block_collection | flow_collection | SCALAR + # flow_content ::= flow_collection | SCALAR + # block_collection ::= block_sequence | block_mapping + # flow_collection ::= flow_sequence | flow_mapping + + def parse_block_node(self): + return self.parse_node(block=True) + + def parse_flow_node(self): + return self.parse_node() + + def parse_block_node_or_indentless_sequence(self): + return self.parse_node(block=True, indentless_sequence=True) + + def parse_node(self, block=False, indentless_sequence=False): + if self.check_token(AliasToken): + token = self.get_token() + event = AliasEvent(token.value, token.start_mark, token.end_mark) + self.state = self.states.pop() + else: + anchor = None + tag = None + start_mark = end_mark = tag_mark = None + if self.check_token(AnchorToken): + token = self.get_token() + start_mark = token.start_mark + end_mark = token.end_mark + anchor = token.value + if self.check_token(TagToken): + token = self.get_token() + tag_mark = token.start_mark + end_mark = token.end_mark + tag = token.value + elif self.check_token(TagToken): + token = self.get_token() + start_mark = tag_mark = token.start_mark + end_mark = token.end_mark + tag = token.value + if self.check_token(AnchorToken): + token = self.get_token() + end_mark = token.end_mark + anchor = token.value + if tag is not None: + handle, suffix = tag + if handle is not None: + if handle not in self.tag_handles: + raise ParserError("while parsing a node", start_mark, + "found undefined tag handle %r" % handle, + tag_mark) + tag = self.tag_handles[handle]+suffix + else: + tag = suffix + #if tag == '!': + # raise ParserError("while parsing a node", start_mark, + # "found non-specific tag '!'", tag_mark, + # "Please check 'http://pyyaml.org/wiki/YAMLNonSpecificTag' and share your opinion.") + if start_mark is None: + start_mark = end_mark = self.peek_token().start_mark + event = None + implicit = (tag is None or tag == '!') + if indentless_sequence and self.check_token(BlockEntryToken): + end_mark = self.peek_token().end_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark) + self.state = self.parse_indentless_sequence_entry + else: + if self.check_token(ScalarToken): + token = self.get_token() + end_mark = token.end_mark + if (token.plain and tag is None) or tag == '!': + implicit = (True, False) + elif tag is None: + implicit = (False, True) + else: + implicit = (False, False) + event = ScalarEvent(anchor, tag, implicit, token.value, + start_mark, end_mark, style=token.style) + self.state = self.states.pop() + elif self.check_token(FlowSequenceStartToken): + end_mark = self.peek_token().end_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=True) + self.state = self.parse_flow_sequence_first_entry + elif self.check_token(FlowMappingStartToken): + end_mark = self.peek_token().end_mark + event = MappingStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=True) + self.state = self.parse_flow_mapping_first_key + elif block and self.check_token(BlockSequenceStartToken): + end_mark = self.peek_token().start_mark + event = SequenceStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=False) + self.state = self.parse_block_sequence_first_entry + elif block and self.check_token(BlockMappingStartToken): + end_mark = self.peek_token().start_mark + event = MappingStartEvent(anchor, tag, implicit, + start_mark, end_mark, flow_style=False) + self.state = self.parse_block_mapping_first_key + elif anchor is not None or tag is not None: + # Empty scalars are allowed even if a tag or an anchor is + # specified. + event = ScalarEvent(anchor, tag, (implicit, False), '', + start_mark, end_mark) + self.state = self.states.pop() + else: + if block: + node = 'block' + else: + node = 'flow' + token = self.peek_token() + raise ParserError("while parsing a %s node" % node, start_mark, + "expected the node content, but found %r" % token.id, + token.start_mark) + return event + + # block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END + + def parse_block_sequence_first_entry(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_block_sequence_entry() + + def parse_block_sequence_entry(self): + if self.check_token(BlockEntryToken): + token = self.get_token() + if not self.check_token(BlockEntryToken, BlockEndToken): + self.states.append(self.parse_block_sequence_entry) + return self.parse_block_node() + else: + self.state = self.parse_block_sequence_entry + return self.process_empty_scalar(token.end_mark) + if not self.check_token(BlockEndToken): + token = self.peek_token() + raise ParserError("while parsing a block collection", self.marks[-1], + "expected , but found %r" % token.id, token.start_mark) + token = self.get_token() + event = SequenceEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + # indentless_sequence ::= (BLOCK-ENTRY block_node?)+ + + def parse_indentless_sequence_entry(self): + if self.check_token(BlockEntryToken): + token = self.get_token() + if not self.check_token(BlockEntryToken, + KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_indentless_sequence_entry) + return self.parse_block_node() + else: + self.state = self.parse_indentless_sequence_entry + return self.process_empty_scalar(token.end_mark) + token = self.peek_token() + event = SequenceEndEvent(token.start_mark, token.start_mark) + self.state = self.states.pop() + return event + + # block_mapping ::= BLOCK-MAPPING_START + # ((KEY block_node_or_indentless_sequence?)? + # (VALUE block_node_or_indentless_sequence?)?)* + # BLOCK-END + + def parse_block_mapping_first_key(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_block_mapping_key() + + def parse_block_mapping_key(self): + if self.check_token(KeyToken): + token = self.get_token() + if not self.check_token(KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_block_mapping_value) + return self.parse_block_node_or_indentless_sequence() + else: + self.state = self.parse_block_mapping_value + return self.process_empty_scalar(token.end_mark) + if not self.check_token(BlockEndToken): + token = self.peek_token() + raise ParserError("while parsing a block mapping", self.marks[-1], + "expected , but found %r" % token.id, token.start_mark) + token = self.get_token() + event = MappingEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_block_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(KeyToken, ValueToken, BlockEndToken): + self.states.append(self.parse_block_mapping_key) + return self.parse_block_node_or_indentless_sequence() + else: + self.state = self.parse_block_mapping_key + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_block_mapping_key + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + # flow_sequence ::= FLOW-SEQUENCE-START + # (flow_sequence_entry FLOW-ENTRY)* + # flow_sequence_entry? + # FLOW-SEQUENCE-END + # flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + # + # Note that while production rules for both flow_sequence_entry and + # flow_mapping_entry are equal, their interpretations are different. + # For `flow_sequence_entry`, the part `KEY flow_node? (VALUE flow_node?)?` + # generate an inline mapping (set syntax). + + def parse_flow_sequence_first_entry(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_flow_sequence_entry(first=True) + + def parse_flow_sequence_entry(self, first=False): + if not self.check_token(FlowSequenceEndToken): + if not first: + if self.check_token(FlowEntryToken): + self.get_token() + else: + token = self.peek_token() + raise ParserError("while parsing a flow sequence", self.marks[-1], + "expected ',' or ']', but got %r" % token.id, token.start_mark) + + if self.check_token(KeyToken): + token = self.peek_token() + event = MappingStartEvent(None, None, True, + token.start_mark, token.end_mark, + flow_style=True) + self.state = self.parse_flow_sequence_entry_mapping_key + return event + elif not self.check_token(FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry) + return self.parse_flow_node() + token = self.get_token() + event = SequenceEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_flow_sequence_entry_mapping_key(self): + token = self.get_token() + if not self.check_token(ValueToken, + FlowEntryToken, FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry_mapping_value) + return self.parse_flow_node() + else: + self.state = self.parse_flow_sequence_entry_mapping_value + return self.process_empty_scalar(token.end_mark) + + def parse_flow_sequence_entry_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(FlowEntryToken, FlowSequenceEndToken): + self.states.append(self.parse_flow_sequence_entry_mapping_end) + return self.parse_flow_node() + else: + self.state = self.parse_flow_sequence_entry_mapping_end + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_flow_sequence_entry_mapping_end + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + def parse_flow_sequence_entry_mapping_end(self): + self.state = self.parse_flow_sequence_entry + token = self.peek_token() + return MappingEndEvent(token.start_mark, token.start_mark) + + # flow_mapping ::= FLOW-MAPPING-START + # (flow_mapping_entry FLOW-ENTRY)* + # flow_mapping_entry? + # FLOW-MAPPING-END + # flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? + + def parse_flow_mapping_first_key(self): + token = self.get_token() + self.marks.append(token.start_mark) + return self.parse_flow_mapping_key(first=True) + + def parse_flow_mapping_key(self, first=False): + if not self.check_token(FlowMappingEndToken): + if not first: + if self.check_token(FlowEntryToken): + self.get_token() + else: + token = self.peek_token() + raise ParserError("while parsing a flow mapping", self.marks[-1], + "expected ',' or '}', but got %r" % token.id, token.start_mark) + if self.check_token(KeyToken): + token = self.get_token() + if not self.check_token(ValueToken, + FlowEntryToken, FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_value) + return self.parse_flow_node() + else: + self.state = self.parse_flow_mapping_value + return self.process_empty_scalar(token.end_mark) + elif not self.check_token(FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_empty_value) + return self.parse_flow_node() + token = self.get_token() + event = MappingEndEvent(token.start_mark, token.end_mark) + self.state = self.states.pop() + self.marks.pop() + return event + + def parse_flow_mapping_value(self): + if self.check_token(ValueToken): + token = self.get_token() + if not self.check_token(FlowEntryToken, FlowMappingEndToken): + self.states.append(self.parse_flow_mapping_key) + return self.parse_flow_node() + else: + self.state = self.parse_flow_mapping_key + return self.process_empty_scalar(token.end_mark) + else: + self.state = self.parse_flow_mapping_key + token = self.peek_token() + return self.process_empty_scalar(token.start_mark) + + def parse_flow_mapping_empty_value(self): + self.state = self.parse_flow_mapping_key + return self.process_empty_scalar(self.peek_token().start_mark) + + def process_empty_scalar(self, mark): + return ScalarEvent(None, None, (True, False), '', mark, mark) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/reader.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/reader.py new file mode 100644 index 00000000..774b0219 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/reader.py @@ -0,0 +1,185 @@ +# This module contains abstractions for the input stream. You don't have to +# looks further, there are no pretty code. +# +# We define two classes here. +# +# Mark(source, line, column) +# It's just a record and its only use is producing nice error messages. +# Parser does not use it for any other purposes. +# +# Reader(source, data) +# Reader determines the encoding of `data` and converts it to unicode. +# Reader provides the following methods and attributes: +# reader.peek(length=1) - return the next `length` characters +# reader.forward(length=1) - move the current position to `length` characters. +# reader.index - the number of the current character. +# reader.line, stream.column - the line and the column of the current character. + +__all__ = ['Reader', 'ReaderError'] + +from .error import YAMLError, Mark + +import codecs, re + +class ReaderError(YAMLError): + + def __init__(self, name, position, character, encoding, reason): + self.name = name + self.character = character + self.position = position + self.encoding = encoding + self.reason = reason + + def __str__(self): + if isinstance(self.character, bytes): + return "'%s' codec can't decode byte #x%02x: %s\n" \ + " in \"%s\", position %d" \ + % (self.encoding, ord(self.character), self.reason, + self.name, self.position) + else: + return "unacceptable character #x%04x: %s\n" \ + " in \"%s\", position %d" \ + % (self.character, self.reason, + self.name, self.position) + +class Reader(object): + # Reader: + # - determines the data encoding and converts it to a unicode string, + # - checks if characters are in allowed range, + # - adds '\0' to the end. + + # Reader accepts + # - a `bytes` object, + # - a `str` object, + # - a file-like object with its `read` method returning `str`, + # - a file-like object with its `read` method returning `unicode`. + + # Yeah, it's ugly and slow. + + def __init__(self, stream): + self.name = None + self.stream = None + self.stream_pointer = 0 + self.eof = True + self.buffer = '' + self.pointer = 0 + self.raw_buffer = None + self.raw_decode = None + self.encoding = None + self.index = 0 + self.line = 0 + self.column = 0 + if isinstance(stream, str): + self.name = "" + self.check_printable(stream) + self.buffer = stream+'\0' + elif isinstance(stream, bytes): + self.name = "" + self.raw_buffer = stream + self.determine_encoding() + else: + self.stream = stream + self.name = getattr(stream, 'name', "") + self.eof = False + self.raw_buffer = None + self.determine_encoding() + + def peek(self, index=0): + try: + return self.buffer[self.pointer+index] + except IndexError: + self.update(index+1) + return self.buffer[self.pointer+index] + + def prefix(self, length=1): + if self.pointer+length >= len(self.buffer): + self.update(length) + return self.buffer[self.pointer:self.pointer+length] + + def forward(self, length=1): + if self.pointer+length+1 >= len(self.buffer): + self.update(length+1) + while length: + ch = self.buffer[self.pointer] + self.pointer += 1 + self.index += 1 + if ch in '\n\x85\u2028\u2029' \ + or (ch == '\r' and self.buffer[self.pointer] != '\n'): + self.line += 1 + self.column = 0 + elif ch != '\uFEFF': + self.column += 1 + length -= 1 + + def get_mark(self): + if self.stream is None: + return Mark(self.name, self.index, self.line, self.column, + self.buffer, self.pointer) + else: + return Mark(self.name, self.index, self.line, self.column, + None, None) + + def determine_encoding(self): + while not self.eof and (self.raw_buffer is None or len(self.raw_buffer) < 2): + self.update_raw() + if isinstance(self.raw_buffer, bytes): + if self.raw_buffer.startswith(codecs.BOM_UTF16_LE): + self.raw_decode = codecs.utf_16_le_decode + self.encoding = 'utf-16-le' + elif self.raw_buffer.startswith(codecs.BOM_UTF16_BE): + self.raw_decode = codecs.utf_16_be_decode + self.encoding = 'utf-16-be' + else: + self.raw_decode = codecs.utf_8_decode + self.encoding = 'utf-8' + self.update(1) + + NON_PRINTABLE = re.compile('[^\x09\x0A\x0D\x20-\x7E\x85\xA0-\uD7FF\uE000-\uFFFD\U00010000-\U0010ffff]') + def check_printable(self, data): + match = self.NON_PRINTABLE.search(data) + if match: + character = match.group() + position = self.index+(len(self.buffer)-self.pointer)+match.start() + raise ReaderError(self.name, position, ord(character), + 'unicode', "special characters are not allowed") + + def update(self, length): + if self.raw_buffer is None: + return + self.buffer = self.buffer[self.pointer:] + self.pointer = 0 + while len(self.buffer) < length: + if not self.eof: + self.update_raw() + if self.raw_decode is not None: + try: + data, converted = self.raw_decode(self.raw_buffer, + 'strict', self.eof) + except UnicodeDecodeError as exc: + character = self.raw_buffer[exc.start] + if self.stream is not None: + position = self.stream_pointer-len(self.raw_buffer)+exc.start + else: + position = exc.start + raise ReaderError(self.name, position, character, + exc.encoding, exc.reason) + else: + data = self.raw_buffer + converted = len(data) + self.check_printable(data) + self.buffer += data + self.raw_buffer = self.raw_buffer[converted:] + if self.eof: + self.buffer += '\0' + self.raw_buffer = None + break + + def update_raw(self, size=4096): + data = self.stream.read(size) + if self.raw_buffer is None: + self.raw_buffer = data + else: + self.raw_buffer += data + self.stream_pointer += len(data) + if not data: + self.eof = True diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/representer.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/representer.py new file mode 100644 index 00000000..3b0b192e --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/representer.py @@ -0,0 +1,389 @@ + +__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', + 'RepresenterError'] + +from .error import * +from .nodes import * + +import datetime, copyreg, types, base64, collections + +class RepresenterError(YAMLError): + pass + +class BaseRepresenter: + + yaml_representers = {} + yaml_multi_representers = {} + + def __init__(self, default_style=None, default_flow_style=False, sort_keys=True): + self.default_style = default_style + self.sort_keys = sort_keys + self.default_flow_style = default_flow_style + self.represented_objects = {} + self.object_keeper = [] + self.alias_key = None + + def represent(self, data): + node = self.represent_data(data) + self.serialize(node) + self.represented_objects = {} + self.object_keeper = [] + self.alias_key = None + + def represent_data(self, data): + if self.ignore_aliases(data): + self.alias_key = None + else: + self.alias_key = id(data) + if self.alias_key is not None: + if self.alias_key in self.represented_objects: + node = self.represented_objects[self.alias_key] + #if node is None: + # raise RepresenterError("recursive objects are not allowed: %r" % data) + return node + #self.represented_objects[alias_key] = None + self.object_keeper.append(data) + data_types = type(data).__mro__ + if data_types[0] in self.yaml_representers: + node = self.yaml_representers[data_types[0]](self, data) + else: + for data_type in data_types: + if data_type in self.yaml_multi_representers: + node = self.yaml_multi_representers[data_type](self, data) + break + else: + if None in self.yaml_multi_representers: + node = self.yaml_multi_representers[None](self, data) + elif None in self.yaml_representers: + node = self.yaml_representers[None](self, data) + else: + node = ScalarNode(None, str(data)) + #if alias_key is not None: + # self.represented_objects[alias_key] = node + return node + + @classmethod + def add_representer(cls, data_type, representer): + if not 'yaml_representers' in cls.__dict__: + cls.yaml_representers = cls.yaml_representers.copy() + cls.yaml_representers[data_type] = representer + + @classmethod + def add_multi_representer(cls, data_type, representer): + if not 'yaml_multi_representers' in cls.__dict__: + cls.yaml_multi_representers = cls.yaml_multi_representers.copy() + cls.yaml_multi_representers[data_type] = representer + + def represent_scalar(self, tag, value, style=None): + if style is None: + style = self.default_style + node = ScalarNode(tag, value, style=style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + return node + + def represent_sequence(self, tag, sequence, flow_style=None): + value = [] + node = SequenceNode(tag, value, flow_style=flow_style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + best_style = True + for item in sequence: + node_item = self.represent_data(item) + if not (isinstance(node_item, ScalarNode) and not node_item.style): + best_style = False + value.append(node_item) + if flow_style is None: + if self.default_flow_style is not None: + node.flow_style = self.default_flow_style + else: + node.flow_style = best_style + return node + + def represent_mapping(self, tag, mapping, flow_style=None): + value = [] + node = MappingNode(tag, value, flow_style=flow_style) + if self.alias_key is not None: + self.represented_objects[self.alias_key] = node + best_style = True + if hasattr(mapping, 'items'): + mapping = list(mapping.items()) + if self.sort_keys: + try: + mapping = sorted(mapping) + except TypeError: + pass + for item_key, item_value in mapping: + node_key = self.represent_data(item_key) + node_value = self.represent_data(item_value) + if not (isinstance(node_key, ScalarNode) and not node_key.style): + best_style = False + if not (isinstance(node_value, ScalarNode) and not node_value.style): + best_style = False + value.append((node_key, node_value)) + if flow_style is None: + if self.default_flow_style is not None: + node.flow_style = self.default_flow_style + else: + node.flow_style = best_style + return node + + def ignore_aliases(self, data): + return False + +class SafeRepresenter(BaseRepresenter): + + def ignore_aliases(self, data): + if data is None: + return True + if isinstance(data, tuple) and data == (): + return True + if isinstance(data, (str, bytes, bool, int, float)): + return True + + def represent_none(self, data): + return self.represent_scalar('tag:yaml.org,2002:null', 'null') + + def represent_str(self, data): + return self.represent_scalar('tag:yaml.org,2002:str', data) + + def represent_binary(self, data): + if hasattr(base64, 'encodebytes'): + data = base64.encodebytes(data).decode('ascii') + else: + data = base64.encodestring(data).decode('ascii') + return self.represent_scalar('tag:yaml.org,2002:binary', data, style='|') + + def represent_bool(self, data): + if data: + value = 'true' + else: + value = 'false' + return self.represent_scalar('tag:yaml.org,2002:bool', value) + + def represent_int(self, data): + return self.represent_scalar('tag:yaml.org,2002:int', str(data)) + + inf_value = 1e300 + while repr(inf_value) != repr(inf_value*inf_value): + inf_value *= inf_value + + def represent_float(self, data): + if data != data or (data == 0.0 and data == 1.0): + value = '.nan' + elif data == self.inf_value: + value = '.inf' + elif data == -self.inf_value: + value = '-.inf' + else: + value = repr(data).lower() + # Note that in some cases `repr(data)` represents a float number + # without the decimal parts. For instance: + # >>> repr(1e17) + # '1e17' + # Unfortunately, this is not a valid float representation according + # to the definition of the `!!float` tag. We fix this by adding + # '.0' before the 'e' symbol. + if '.' not in value and 'e' in value: + value = value.replace('e', '.0e', 1) + return self.represent_scalar('tag:yaml.org,2002:float', value) + + def represent_list(self, data): + #pairs = (len(data) > 0 and isinstance(data, list)) + #if pairs: + # for item in data: + # if not isinstance(item, tuple) or len(item) != 2: + # pairs = False + # break + #if not pairs: + return self.represent_sequence('tag:yaml.org,2002:seq', data) + #value = [] + #for item_key, item_value in data: + # value.append(self.represent_mapping(u'tag:yaml.org,2002:map', + # [(item_key, item_value)])) + #return SequenceNode(u'tag:yaml.org,2002:pairs', value) + + def represent_dict(self, data): + return self.represent_mapping('tag:yaml.org,2002:map', data) + + def represent_set(self, data): + value = {} + for key in data: + value[key] = None + return self.represent_mapping('tag:yaml.org,2002:set', value) + + def represent_date(self, data): + value = data.isoformat() + return self.represent_scalar('tag:yaml.org,2002:timestamp', value) + + def represent_datetime(self, data): + value = data.isoformat(' ') + return self.represent_scalar('tag:yaml.org,2002:timestamp', value) + + def represent_yaml_object(self, tag, data, cls, flow_style=None): + if hasattr(data, '__getstate__'): + state = data.__getstate__() + else: + state = data.__dict__.copy() + return self.represent_mapping(tag, state, flow_style=flow_style) + + def represent_undefined(self, data): + raise RepresenterError("cannot represent an object", data) + +SafeRepresenter.add_representer(type(None), + SafeRepresenter.represent_none) + +SafeRepresenter.add_representer(str, + SafeRepresenter.represent_str) + +SafeRepresenter.add_representer(bytes, + SafeRepresenter.represent_binary) + +SafeRepresenter.add_representer(bool, + SafeRepresenter.represent_bool) + +SafeRepresenter.add_representer(int, + SafeRepresenter.represent_int) + +SafeRepresenter.add_representer(float, + SafeRepresenter.represent_float) + +SafeRepresenter.add_representer(list, + SafeRepresenter.represent_list) + +SafeRepresenter.add_representer(tuple, + SafeRepresenter.represent_list) + +SafeRepresenter.add_representer(dict, + SafeRepresenter.represent_dict) + +SafeRepresenter.add_representer(set, + SafeRepresenter.represent_set) + +SafeRepresenter.add_representer(datetime.date, + SafeRepresenter.represent_date) + +SafeRepresenter.add_representer(datetime.datetime, + SafeRepresenter.represent_datetime) + +SafeRepresenter.add_representer(None, + SafeRepresenter.represent_undefined) + +class Representer(SafeRepresenter): + + def represent_complex(self, data): + if data.imag == 0.0: + data = '%r' % data.real + elif data.real == 0.0: + data = '%rj' % data.imag + elif data.imag > 0: + data = '%r+%rj' % (data.real, data.imag) + else: + data = '%r%rj' % (data.real, data.imag) + return self.represent_scalar('tag:yaml.org,2002:python/complex', data) + + def represent_tuple(self, data): + return self.represent_sequence('tag:yaml.org,2002:python/tuple', data) + + def represent_name(self, data): + name = '%s.%s' % (data.__module__, data.__name__) + return self.represent_scalar('tag:yaml.org,2002:python/name:'+name, '') + + def represent_module(self, data): + return self.represent_scalar( + 'tag:yaml.org,2002:python/module:'+data.__name__, '') + + def represent_object(self, data): + # We use __reduce__ API to save the data. data.__reduce__ returns + # a tuple of length 2-5: + # (function, args, state, listitems, dictitems) + + # For reconstructing, we calls function(*args), then set its state, + # listitems, and dictitems if they are not None. + + # A special case is when function.__name__ == '__newobj__'. In this + # case we create the object with args[0].__new__(*args). + + # Another special case is when __reduce__ returns a string - we don't + # support it. + + # We produce a !!python/object, !!python/object/new or + # !!python/object/apply node. + + cls = type(data) + if cls in copyreg.dispatch_table: + reduce = copyreg.dispatch_table[cls](data) + elif hasattr(data, '__reduce_ex__'): + reduce = data.__reduce_ex__(2) + elif hasattr(data, '__reduce__'): + reduce = data.__reduce__() + else: + raise RepresenterError("cannot represent an object", data) + reduce = (list(reduce)+[None]*5)[:5] + function, args, state, listitems, dictitems = reduce + args = list(args) + if state is None: + state = {} + if listitems is not None: + listitems = list(listitems) + if dictitems is not None: + dictitems = dict(dictitems) + if function.__name__ == '__newobj__': + function = args[0] + args = args[1:] + tag = 'tag:yaml.org,2002:python/object/new:' + newobj = True + else: + tag = 'tag:yaml.org,2002:python/object/apply:' + newobj = False + function_name = '%s.%s' % (function.__module__, function.__name__) + if not args and not listitems and not dictitems \ + and isinstance(state, dict) and newobj: + return self.represent_mapping( + 'tag:yaml.org,2002:python/object:'+function_name, state) + if not listitems and not dictitems \ + and isinstance(state, dict) and not state: + return self.represent_sequence(tag+function_name, args) + value = {} + if args: + value['args'] = args + if state or not isinstance(state, dict): + value['state'] = state + if listitems: + value['listitems'] = listitems + if dictitems: + value['dictitems'] = dictitems + return self.represent_mapping(tag+function_name, value) + + def represent_ordered_dict(self, data): + # Provide uniform representation across different Python versions. + data_type = type(data) + tag = 'tag:yaml.org,2002:python/object/apply:%s.%s' \ + % (data_type.__module__, data_type.__name__) + items = [[key, value] for key, value in data.items()] + return self.represent_sequence(tag, [items]) + +Representer.add_representer(complex, + Representer.represent_complex) + +Representer.add_representer(tuple, + Representer.represent_tuple) + +Representer.add_representer(type, + Representer.represent_name) + +Representer.add_representer(collections.OrderedDict, + Representer.represent_ordered_dict) + +Representer.add_representer(types.FunctionType, + Representer.represent_name) + +Representer.add_representer(types.BuiltinFunctionType, + Representer.represent_name) + +Representer.add_representer(types.ModuleType, + Representer.represent_module) + +Representer.add_multi_representer(object, + Representer.represent_object) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/resolver.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/resolver.py new file mode 100644 index 00000000..02b82e73 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/resolver.py @@ -0,0 +1,227 @@ + +__all__ = ['BaseResolver', 'Resolver'] + +from .error import * +from .nodes import * + +import re + +class ResolverError(YAMLError): + pass + +class BaseResolver: + + DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str' + DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq' + DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map' + + yaml_implicit_resolvers = {} + yaml_path_resolvers = {} + + def __init__(self): + self.resolver_exact_paths = [] + self.resolver_prefix_paths = [] + + @classmethod + def add_implicit_resolver(cls, tag, regexp, first): + if not 'yaml_implicit_resolvers' in cls.__dict__: + implicit_resolvers = {} + for key in cls.yaml_implicit_resolvers: + implicit_resolvers[key] = cls.yaml_implicit_resolvers[key][:] + cls.yaml_implicit_resolvers = implicit_resolvers + if first is None: + first = [None] + for ch in first: + cls.yaml_implicit_resolvers.setdefault(ch, []).append((tag, regexp)) + + @classmethod + def add_path_resolver(cls, tag, path, kind=None): + # Note: `add_path_resolver` is experimental. The API could be changed. + # `new_path` is a pattern that is matched against the path from the + # root to the node that is being considered. `node_path` elements are + # tuples `(node_check, index_check)`. `node_check` is a node class: + # `ScalarNode`, `SequenceNode`, `MappingNode` or `None`. `None` + # matches any kind of a node. `index_check` could be `None`, a boolean + # value, a string value, or a number. `None` and `False` match against + # any _value_ of sequence and mapping nodes. `True` matches against + # any _key_ of a mapping node. A string `index_check` matches against + # a mapping value that corresponds to a scalar key which content is + # equal to the `index_check` value. An integer `index_check` matches + # against a sequence value with the index equal to `index_check`. + if not 'yaml_path_resolvers' in cls.__dict__: + cls.yaml_path_resolvers = cls.yaml_path_resolvers.copy() + new_path = [] + for element in path: + if isinstance(element, (list, tuple)): + if len(element) == 2: + node_check, index_check = element + elif len(element) == 1: + node_check = element[0] + index_check = True + else: + raise ResolverError("Invalid path element: %s" % element) + else: + node_check = None + index_check = element + if node_check is str: + node_check = ScalarNode + elif node_check is list: + node_check = SequenceNode + elif node_check is dict: + node_check = MappingNode + elif node_check not in [ScalarNode, SequenceNode, MappingNode] \ + and not isinstance(node_check, str) \ + and node_check is not None: + raise ResolverError("Invalid node checker: %s" % node_check) + if not isinstance(index_check, (str, int)) \ + and index_check is not None: + raise ResolverError("Invalid index checker: %s" % index_check) + new_path.append((node_check, index_check)) + if kind is str: + kind = ScalarNode + elif kind is list: + kind = SequenceNode + elif kind is dict: + kind = MappingNode + elif kind not in [ScalarNode, SequenceNode, MappingNode] \ + and kind is not None: + raise ResolverError("Invalid node kind: %s" % kind) + cls.yaml_path_resolvers[tuple(new_path), kind] = tag + + def descend_resolver(self, current_node, current_index): + if not self.yaml_path_resolvers: + return + exact_paths = {} + prefix_paths = [] + if current_node: + depth = len(self.resolver_prefix_paths) + for path, kind in self.resolver_prefix_paths[-1]: + if self.check_resolver_prefix(depth, path, kind, + current_node, current_index): + if len(path) > depth: + prefix_paths.append((path, kind)) + else: + exact_paths[kind] = self.yaml_path_resolvers[path, kind] + else: + for path, kind in self.yaml_path_resolvers: + if not path: + exact_paths[kind] = self.yaml_path_resolvers[path, kind] + else: + prefix_paths.append((path, kind)) + self.resolver_exact_paths.append(exact_paths) + self.resolver_prefix_paths.append(prefix_paths) + + def ascend_resolver(self): + if not self.yaml_path_resolvers: + return + self.resolver_exact_paths.pop() + self.resolver_prefix_paths.pop() + + def check_resolver_prefix(self, depth, path, kind, + current_node, current_index): + node_check, index_check = path[depth-1] + if isinstance(node_check, str): + if current_node.tag != node_check: + return + elif node_check is not None: + if not isinstance(current_node, node_check): + return + if index_check is True and current_index is not None: + return + if (index_check is False or index_check is None) \ + and current_index is None: + return + if isinstance(index_check, str): + if not (isinstance(current_index, ScalarNode) + and index_check == current_index.value): + return + elif isinstance(index_check, int) and not isinstance(index_check, bool): + if index_check != current_index: + return + return True + + def resolve(self, kind, value, implicit): + if kind is ScalarNode and implicit[0]: + if value == '': + resolvers = self.yaml_implicit_resolvers.get('', []) + else: + resolvers = self.yaml_implicit_resolvers.get(value[0], []) + resolvers += self.yaml_implicit_resolvers.get(None, []) + for tag, regexp in resolvers: + if regexp.match(value): + return tag + implicit = implicit[1] + if self.yaml_path_resolvers: + exact_paths = self.resolver_exact_paths[-1] + if kind in exact_paths: + return exact_paths[kind] + if None in exact_paths: + return exact_paths[None] + if kind is ScalarNode: + return self.DEFAULT_SCALAR_TAG + elif kind is SequenceNode: + return self.DEFAULT_SEQUENCE_TAG + elif kind is MappingNode: + return self.DEFAULT_MAPPING_TAG + +class Resolver(BaseResolver): + pass + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:bool', + re.compile(r'''^(?:yes|Yes|YES|no|No|NO + |true|True|TRUE|false|False|FALSE + |on|On|ON|off|Off|OFF)$''', re.X), + list('yYnNtTfFoO')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:float', + re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)? + |\.[0-9_]+(?:[eE][-+][0-9]+)? + |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]* + |[-+]?\.(?:inf|Inf|INF) + |\.(?:nan|NaN|NAN))$''', re.X), + list('-+0123456789.')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:int', + re.compile(r'''^(?:[-+]?0b[0-1_]+ + |[-+]?0[0-7_]+ + |[-+]?(?:0|[1-9][0-9_]*) + |[-+]?0x[0-9a-fA-F_]+ + |[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$''', re.X), + list('-+0123456789')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:merge', + re.compile(r'^(?:<<)$'), + ['<']) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:null', + re.compile(r'''^(?: ~ + |null|Null|NULL + | )$''', re.X), + ['~', 'n', 'N', '']) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:timestamp', + re.compile(r'''^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] + |[0-9][0-9][0-9][0-9] -[0-9][0-9]? -[0-9][0-9]? + (?:[Tt]|[ \t]+)[0-9][0-9]? + :[0-9][0-9] :[0-9][0-9] (?:\.[0-9]*)? + (?:[ \t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$''', re.X), + list('0123456789')) + +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:value', + re.compile(r'^(?:=)$'), + ['=']) + +# The following resolver is only for documentation purposes. It cannot work +# because plain scalars cannot start with '!', '&', or '*'. +Resolver.add_implicit_resolver( + 'tag:yaml.org,2002:yaml', + re.compile(r'^(?:!|&|\*)$'), + list('!&*')) + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/scanner.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/scanner.py new file mode 100644 index 00000000..7437ede1 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/scanner.py @@ -0,0 +1,1435 @@ + +# Scanner produces tokens of the following types: +# STREAM-START +# STREAM-END +# DIRECTIVE(name, value) +# DOCUMENT-START +# DOCUMENT-END +# BLOCK-SEQUENCE-START +# BLOCK-MAPPING-START +# BLOCK-END +# FLOW-SEQUENCE-START +# FLOW-MAPPING-START +# FLOW-SEQUENCE-END +# FLOW-MAPPING-END +# BLOCK-ENTRY +# FLOW-ENTRY +# KEY +# VALUE +# ALIAS(value) +# ANCHOR(value) +# TAG(value) +# SCALAR(value, plain, style) +# +# Read comments in the Scanner code for more details. +# + +__all__ = ['Scanner', 'ScannerError'] + +from .error import MarkedYAMLError +from .tokens import * + +class ScannerError(MarkedYAMLError): + pass + +class SimpleKey: + # See below simple keys treatment. + + def __init__(self, token_number, required, index, line, column, mark): + self.token_number = token_number + self.required = required + self.index = index + self.line = line + self.column = column + self.mark = mark + +class Scanner: + + def __init__(self): + """Initialize the scanner.""" + # It is assumed that Scanner and Reader will have a common descendant. + # Reader do the dirty work of checking for BOM and converting the + # input data to Unicode. It also adds NUL to the end. + # + # Reader supports the following methods + # self.peek(i=0) # peek the next i-th character + # self.prefix(l=1) # peek the next l characters + # self.forward(l=1) # read the next l characters and move the pointer. + + # Had we reached the end of the stream? + self.done = False + + # The number of unclosed '{' and '['. `flow_level == 0` means block + # context. + self.flow_level = 0 + + # List of processed tokens that are not yet emitted. + self.tokens = [] + + # Add the STREAM-START token. + self.fetch_stream_start() + + # Number of tokens that were emitted through the `get_token` method. + self.tokens_taken = 0 + + # The current indentation level. + self.indent = -1 + + # Past indentation levels. + self.indents = [] + + # Variables related to simple keys treatment. + + # A simple key is a key that is not denoted by the '?' indicator. + # Example of simple keys: + # --- + # block simple key: value + # ? not a simple key: + # : { flow simple key: value } + # We emit the KEY token before all keys, so when we find a potential + # simple key, we try to locate the corresponding ':' indicator. + # Simple keys should be limited to a single line and 1024 characters. + + # Can a simple key start at the current position? A simple key may + # start: + # - at the beginning of the line, not counting indentation spaces + # (in block context), + # - after '{', '[', ',' (in the flow context), + # - after '?', ':', '-' (in the block context). + # In the block context, this flag also signifies if a block collection + # may start at the current position. + self.allow_simple_key = True + + # Keep track of possible simple keys. This is a dictionary. The key + # is `flow_level`; there can be no more that one possible simple key + # for each level. The value is a SimpleKey record: + # (token_number, required, index, line, column, mark) + # A simple key may start with ALIAS, ANCHOR, TAG, SCALAR(flow), + # '[', or '{' tokens. + self.possible_simple_keys = {} + + # Public methods. + + def check_token(self, *choices): + # Check if the next token is one of the given types. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + if not choices: + return True + for choice in choices: + if isinstance(self.tokens[0], choice): + return True + return False + + def peek_token(self): + # Return the next token, but do not delete if from the queue. + # Return None if no more tokens. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + return self.tokens[0] + else: + return None + + def get_token(self): + # Return the next token. + while self.need_more_tokens(): + self.fetch_more_tokens() + if self.tokens: + self.tokens_taken += 1 + return self.tokens.pop(0) + + # Private methods. + + def need_more_tokens(self): + if self.done: + return False + if not self.tokens: + return True + # The current token may be a potential simple key, so we + # need to look further. + self.stale_possible_simple_keys() + if self.next_possible_simple_key() == self.tokens_taken: + return True + + def fetch_more_tokens(self): + + # Eat whitespaces and comments until we reach the next token. + self.scan_to_next_token() + + # Remove obsolete possible simple keys. + self.stale_possible_simple_keys() + + # Compare the current indentation and column. It may add some tokens + # and decrease the current indentation level. + self.unwind_indent(self.column) + + # Peek the next character. + ch = self.peek() + + # Is it the end of stream? + if ch == '\0': + return self.fetch_stream_end() + + # Is it a directive? + if ch == '%' and self.check_directive(): + return self.fetch_directive() + + # Is it the document start? + if ch == '-' and self.check_document_start(): + return self.fetch_document_start() + + # Is it the document end? + if ch == '.' and self.check_document_end(): + return self.fetch_document_end() + + # TODO: support for BOM within a stream. + #if ch == '\uFEFF': + # return self.fetch_bom() <-- issue BOMToken + + # Note: the order of the following checks is NOT significant. + + # Is it the flow sequence start indicator? + if ch == '[': + return self.fetch_flow_sequence_start() + + # Is it the flow mapping start indicator? + if ch == '{': + return self.fetch_flow_mapping_start() + + # Is it the flow sequence end indicator? + if ch == ']': + return self.fetch_flow_sequence_end() + + # Is it the flow mapping end indicator? + if ch == '}': + return self.fetch_flow_mapping_end() + + # Is it the flow entry indicator? + if ch == ',': + return self.fetch_flow_entry() + + # Is it the block entry indicator? + if ch == '-' and self.check_block_entry(): + return self.fetch_block_entry() + + # Is it the key indicator? + if ch == '?' and self.check_key(): + return self.fetch_key() + + # Is it the value indicator? + if ch == ':' and self.check_value(): + return self.fetch_value() + + # Is it an alias? + if ch == '*': + return self.fetch_alias() + + # Is it an anchor? + if ch == '&': + return self.fetch_anchor() + + # Is it a tag? + if ch == '!': + return self.fetch_tag() + + # Is it a literal scalar? + if ch == '|' and not self.flow_level: + return self.fetch_literal() + + # Is it a folded scalar? + if ch == '>' and not self.flow_level: + return self.fetch_folded() + + # Is it a single quoted scalar? + if ch == '\'': + return self.fetch_single() + + # Is it a double quoted scalar? + if ch == '\"': + return self.fetch_double() + + # It must be a plain scalar then. + if self.check_plain(): + return self.fetch_plain() + + # No? It's an error. Let's produce a nice error message. + raise ScannerError("while scanning for the next token", None, + "found character %r that cannot start any token" % ch, + self.get_mark()) + + # Simple keys treatment. + + def next_possible_simple_key(self): + # Return the number of the nearest possible simple key. Actually we + # don't need to loop through the whole dictionary. We may replace it + # with the following code: + # if not self.possible_simple_keys: + # return None + # return self.possible_simple_keys[ + # min(self.possible_simple_keys.keys())].token_number + min_token_number = None + for level in self.possible_simple_keys: + key = self.possible_simple_keys[level] + if min_token_number is None or key.token_number < min_token_number: + min_token_number = key.token_number + return min_token_number + + def stale_possible_simple_keys(self): + # Remove entries that are no longer possible simple keys. According to + # the YAML specification, simple keys + # - should be limited to a single line, + # - should be no longer than 1024 characters. + # Disabling this procedure will allow simple keys of any length and + # height (may cause problems if indentation is broken though). + for level in list(self.possible_simple_keys): + key = self.possible_simple_keys[level] + if key.line != self.line \ + or self.index-key.index > 1024: + if key.required: + raise ScannerError("while scanning a simple key", key.mark, + "could not find expected ':'", self.get_mark()) + del self.possible_simple_keys[level] + + def save_possible_simple_key(self): + # The next token may start a simple key. We check if it's possible + # and save its position. This function is called for + # ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'. + + # Check if a simple key is required at the current position. + required = not self.flow_level and self.indent == self.column + + # The next token might be a simple key. Let's save it's number and + # position. + if self.allow_simple_key: + self.remove_possible_simple_key() + token_number = self.tokens_taken+len(self.tokens) + key = SimpleKey(token_number, required, + self.index, self.line, self.column, self.get_mark()) + self.possible_simple_keys[self.flow_level] = key + + def remove_possible_simple_key(self): + # Remove the saved possible key position at the current flow level. + if self.flow_level in self.possible_simple_keys: + key = self.possible_simple_keys[self.flow_level] + + if key.required: + raise ScannerError("while scanning a simple key", key.mark, + "could not find expected ':'", self.get_mark()) + + del self.possible_simple_keys[self.flow_level] + + # Indentation functions. + + def unwind_indent(self, column): + + ## In flow context, tokens should respect indentation. + ## Actually the condition should be `self.indent >= column` according to + ## the spec. But this condition will prohibit intuitively correct + ## constructions such as + ## key : { + ## } + #if self.flow_level and self.indent > column: + # raise ScannerError(None, None, + # "invalid indentation or unclosed '[' or '{'", + # self.get_mark()) + + # In the flow context, indentation is ignored. We make the scanner less + # restrictive then specification requires. + if self.flow_level: + return + + # In block context, we may need to issue the BLOCK-END tokens. + while self.indent > column: + mark = self.get_mark() + self.indent = self.indents.pop() + self.tokens.append(BlockEndToken(mark, mark)) + + def add_indent(self, column): + # Check if we need to increase indentation. + if self.indent < column: + self.indents.append(self.indent) + self.indent = column + return True + return False + + # Fetchers. + + def fetch_stream_start(self): + # We always add STREAM-START as the first token and STREAM-END as the + # last token. + + # Read the token. + mark = self.get_mark() + + # Add STREAM-START. + self.tokens.append(StreamStartToken(mark, mark, + encoding=self.encoding)) + + + def fetch_stream_end(self): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. + self.remove_possible_simple_key() + self.allow_simple_key = False + self.possible_simple_keys = {} + + # Read the token. + mark = self.get_mark() + + # Add STREAM-END. + self.tokens.append(StreamEndToken(mark, mark)) + + # The steam is finished. + self.done = True + + def fetch_directive(self): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. + self.remove_possible_simple_key() + self.allow_simple_key = False + + # Scan and add DIRECTIVE. + self.tokens.append(self.scan_directive()) + + def fetch_document_start(self): + self.fetch_document_indicator(DocumentStartToken) + + def fetch_document_end(self): + self.fetch_document_indicator(DocumentEndToken) + + def fetch_document_indicator(self, TokenClass): + + # Set the current indentation to -1. + self.unwind_indent(-1) + + # Reset simple keys. Note that there could not be a block collection + # after '---'. + self.remove_possible_simple_key() + self.allow_simple_key = False + + # Add DOCUMENT-START or DOCUMENT-END. + start_mark = self.get_mark() + self.forward(3) + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_sequence_start(self): + self.fetch_flow_collection_start(FlowSequenceStartToken) + + def fetch_flow_mapping_start(self): + self.fetch_flow_collection_start(FlowMappingStartToken) + + def fetch_flow_collection_start(self, TokenClass): + + # '[' and '{' may start a simple key. + self.save_possible_simple_key() + + # Increase the flow level. + self.flow_level += 1 + + # Simple keys are allowed after '[' and '{'. + self.allow_simple_key = True + + # Add FLOW-SEQUENCE-START or FLOW-MAPPING-START. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_sequence_end(self): + self.fetch_flow_collection_end(FlowSequenceEndToken) + + def fetch_flow_mapping_end(self): + self.fetch_flow_collection_end(FlowMappingEndToken) + + def fetch_flow_collection_end(self, TokenClass): + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Decrease the flow level. + self.flow_level -= 1 + + # No simple keys after ']' or '}'. + self.allow_simple_key = False + + # Add FLOW-SEQUENCE-END or FLOW-MAPPING-END. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(TokenClass(start_mark, end_mark)) + + def fetch_flow_entry(self): + + # Simple keys are allowed after ','. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add FLOW-ENTRY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(FlowEntryToken(start_mark, end_mark)) + + def fetch_block_entry(self): + + # Block context needs additional checks. + if not self.flow_level: + + # Are we allowed to start a new entry? + if not self.allow_simple_key: + raise ScannerError(None, None, + "sequence entries are not allowed here", + self.get_mark()) + + # We may need to add BLOCK-SEQUENCE-START. + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockSequenceStartToken(mark, mark)) + + # It's an error for the block entry to occur in the flow context, + # but we let the parser detect this. + else: + pass + + # Simple keys are allowed after '-'. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add BLOCK-ENTRY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(BlockEntryToken(start_mark, end_mark)) + + def fetch_key(self): + + # Block context needs additional checks. + if not self.flow_level: + + # Are we allowed to start a key (not necessary a simple)? + if not self.allow_simple_key: + raise ScannerError(None, None, + "mapping keys are not allowed here", + self.get_mark()) + + # We may need to add BLOCK-MAPPING-START. + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockMappingStartToken(mark, mark)) + + # Simple keys are allowed after '?' in the block context. + self.allow_simple_key = not self.flow_level + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add KEY. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(KeyToken(start_mark, end_mark)) + + def fetch_value(self): + + # Do we determine a simple key? + if self.flow_level in self.possible_simple_keys: + + # Add KEY. + key = self.possible_simple_keys[self.flow_level] + del self.possible_simple_keys[self.flow_level] + self.tokens.insert(key.token_number-self.tokens_taken, + KeyToken(key.mark, key.mark)) + + # If this key starts a new block mapping, we need to add + # BLOCK-MAPPING-START. + if not self.flow_level: + if self.add_indent(key.column): + self.tokens.insert(key.token_number-self.tokens_taken, + BlockMappingStartToken(key.mark, key.mark)) + + # There cannot be two simple keys one after another. + self.allow_simple_key = False + + # It must be a part of a complex key. + else: + + # Block context needs additional checks. + # (Do we really need them? They will be caught by the parser + # anyway.) + if not self.flow_level: + + # We are allowed to start a complex value if and only if + # we can start a simple key. + if not self.allow_simple_key: + raise ScannerError(None, None, + "mapping values are not allowed here", + self.get_mark()) + + # If this value starts a new block mapping, we need to add + # BLOCK-MAPPING-START. It will be detected as an error later by + # the parser. + if not self.flow_level: + if self.add_indent(self.column): + mark = self.get_mark() + self.tokens.append(BlockMappingStartToken(mark, mark)) + + # Simple keys are allowed after ':' in the block context. + self.allow_simple_key = not self.flow_level + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Add VALUE. + start_mark = self.get_mark() + self.forward() + end_mark = self.get_mark() + self.tokens.append(ValueToken(start_mark, end_mark)) + + def fetch_alias(self): + + # ALIAS could be a simple key. + self.save_possible_simple_key() + + # No simple keys after ALIAS. + self.allow_simple_key = False + + # Scan and add ALIAS. + self.tokens.append(self.scan_anchor(AliasToken)) + + def fetch_anchor(self): + + # ANCHOR could start a simple key. + self.save_possible_simple_key() + + # No simple keys after ANCHOR. + self.allow_simple_key = False + + # Scan and add ANCHOR. + self.tokens.append(self.scan_anchor(AnchorToken)) + + def fetch_tag(self): + + # TAG could start a simple key. + self.save_possible_simple_key() + + # No simple keys after TAG. + self.allow_simple_key = False + + # Scan and add TAG. + self.tokens.append(self.scan_tag()) + + def fetch_literal(self): + self.fetch_block_scalar(style='|') + + def fetch_folded(self): + self.fetch_block_scalar(style='>') + + def fetch_block_scalar(self, style): + + # A simple key may follow a block scalar. + self.allow_simple_key = True + + # Reset possible simple key on the current level. + self.remove_possible_simple_key() + + # Scan and add SCALAR. + self.tokens.append(self.scan_block_scalar(style)) + + def fetch_single(self): + self.fetch_flow_scalar(style='\'') + + def fetch_double(self): + self.fetch_flow_scalar(style='"') + + def fetch_flow_scalar(self, style): + + # A flow scalar could be a simple key. + self.save_possible_simple_key() + + # No simple keys after flow scalars. + self.allow_simple_key = False + + # Scan and add SCALAR. + self.tokens.append(self.scan_flow_scalar(style)) + + def fetch_plain(self): + + # A plain scalar could be a simple key. + self.save_possible_simple_key() + + # No simple keys after plain scalars. But note that `scan_plain` will + # change this flag if the scan is finished at the beginning of the + # line. + self.allow_simple_key = False + + # Scan and add SCALAR. May change `allow_simple_key`. + self.tokens.append(self.scan_plain()) + + # Checkers. + + def check_directive(self): + + # DIRECTIVE: ^ '%' ... + # The '%' indicator is already checked. + if self.column == 0: + return True + + def check_document_start(self): + + # DOCUMENT-START: ^ '---' (' '|'\n') + if self.column == 0: + if self.prefix(3) == '---' \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return True + + def check_document_end(self): + + # DOCUMENT-END: ^ '...' (' '|'\n') + if self.column == 0: + if self.prefix(3) == '...' \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return True + + def check_block_entry(self): + + # BLOCK-ENTRY: '-' (' '|'\n') + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_key(self): + + # KEY(flow context): '?' + if self.flow_level: + return True + + # KEY(block context): '?' (' '|'\n') + else: + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_value(self): + + # VALUE(flow context): ':' + if self.flow_level: + return True + + # VALUE(block context): ':' (' '|'\n') + else: + return self.peek(1) in '\0 \t\r\n\x85\u2028\u2029' + + def check_plain(self): + + # A plain scalar may start with any non-space character except: + # '-', '?', ':', ',', '[', ']', '{', '}', + # '#', '&', '*', '!', '|', '>', '\'', '\"', + # '%', '@', '`'. + # + # It may also start with + # '-', '?', ':' + # if it is followed by a non-space character. + # + # Note that we limit the last rule to the block context (except the + # '-' character) because we want the flow context to be space + # independent. + ch = self.peek() + return ch not in '\0 \t\r\n\x85\u2028\u2029-?:,[]{}#&*!|>\'\"%@`' \ + or (self.peek(1) not in '\0 \t\r\n\x85\u2028\u2029' + and (ch == '-' or (not self.flow_level and ch in '?:'))) + + # Scanners. + + def scan_to_next_token(self): + # We ignore spaces, line breaks and comments. + # If we find a line break in the block context, we set the flag + # `allow_simple_key` on. + # The byte order mark is stripped if it's the first character in the + # stream. We do not yet support BOM inside the stream as the + # specification requires. Any such mark will be considered as a part + # of the document. + # + # TODO: We need to make tab handling rules more sane. A good rule is + # Tabs cannot precede tokens + # BLOCK-SEQUENCE-START, BLOCK-MAPPING-START, BLOCK-END, + # KEY(block), VALUE(block), BLOCK-ENTRY + # So the checking code is + # if : + # self.allow_simple_keys = False + # We also need to add the check for `allow_simple_keys == True` to + # `unwind_indent` before issuing BLOCK-END. + # Scanners for block, flow, and plain scalars need to be modified. + + if self.index == 0 and self.peek() == '\uFEFF': + self.forward() + found = False + while not found: + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + if self.scan_line_break(): + if not self.flow_level: + self.allow_simple_key = True + else: + found = True + + def scan_directive(self): + # See the specification for details. + start_mark = self.get_mark() + self.forward() + name = self.scan_directive_name(start_mark) + value = None + if name == 'YAML': + value = self.scan_yaml_directive_value(start_mark) + end_mark = self.get_mark() + elif name == 'TAG': + value = self.scan_tag_directive_value(start_mark) + end_mark = self.get_mark() + else: + end_mark = self.get_mark() + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + self.scan_directive_ignored_line(start_mark) + return DirectiveToken(name, value, start_mark, end_mark) + + def scan_directive_name(self, start_mark): + # See the specification for details. + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if not length: + raise ScannerError("while scanning a directive", start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + value = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + return value + + def scan_yaml_directive_value(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + major = self.scan_yaml_directive_number(start_mark) + if self.peek() != '.': + raise ScannerError("while scanning a directive", start_mark, + "expected a digit or '.', but found %r" % self.peek(), + self.get_mark()) + self.forward() + minor = self.scan_yaml_directive_number(start_mark) + if self.peek() not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected a digit or ' ', but found %r" % self.peek(), + self.get_mark()) + return (major, minor) + + def scan_yaml_directive_number(self, start_mark): + # See the specification for details. + ch = self.peek() + if not ('0' <= ch <= '9'): + raise ScannerError("while scanning a directive", start_mark, + "expected a digit, but found %r" % ch, self.get_mark()) + length = 0 + while '0' <= self.peek(length) <= '9': + length += 1 + value = int(self.prefix(length)) + self.forward(length) + return value + + def scan_tag_directive_value(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + handle = self.scan_tag_directive_handle(start_mark) + while self.peek() == ' ': + self.forward() + prefix = self.scan_tag_directive_prefix(start_mark) + return (handle, prefix) + + def scan_tag_directive_handle(self, start_mark): + # See the specification for details. + value = self.scan_tag_handle('directive', start_mark) + ch = self.peek() + if ch != ' ': + raise ScannerError("while scanning a directive", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + return value + + def scan_tag_directive_prefix(self, start_mark): + # See the specification for details. + value = self.scan_tag_uri('directive', start_mark) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + return value + + def scan_directive_ignored_line(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + ch = self.peek() + if ch not in '\0\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a directive", start_mark, + "expected a comment or a line break, but found %r" + % ch, self.get_mark()) + self.scan_line_break() + + def scan_anchor(self, TokenClass): + # The specification does not restrict characters for anchors and + # aliases. This may lead to problems, for instance, the document: + # [ *alias, value ] + # can be interpreted in two ways, as + # [ "value" ] + # and + # [ *alias , "value" ] + # Therefore we restrict aliases to numbers and ASCII letters. + start_mark = self.get_mark() + indicator = self.peek() + if indicator == '*': + name = 'alias' + else: + name = 'anchor' + self.forward() + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if not length: + raise ScannerError("while scanning an %s" % name, start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + value = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch not in '\0 \t\r\n\x85\u2028\u2029?:,]}%@`': + raise ScannerError("while scanning an %s" % name, start_mark, + "expected alphabetic or numeric character, but found %r" + % ch, self.get_mark()) + end_mark = self.get_mark() + return TokenClass(value, start_mark, end_mark) + + def scan_tag(self): + # See the specification for details. + start_mark = self.get_mark() + ch = self.peek(1) + if ch == '<': + handle = None + self.forward(2) + suffix = self.scan_tag_uri('tag', start_mark) + if self.peek() != '>': + raise ScannerError("while parsing a tag", start_mark, + "expected '>', but found %r" % self.peek(), + self.get_mark()) + self.forward() + elif ch in '\0 \t\r\n\x85\u2028\u2029': + handle = None + suffix = '!' + self.forward() + else: + length = 1 + use_handle = False + while ch not in '\0 \r\n\x85\u2028\u2029': + if ch == '!': + use_handle = True + break + length += 1 + ch = self.peek(length) + handle = '!' + if use_handle: + handle = self.scan_tag_handle('tag', start_mark) + else: + handle = '!' + self.forward() + suffix = self.scan_tag_uri('tag', start_mark) + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a tag", start_mark, + "expected ' ', but found %r" % ch, self.get_mark()) + value = (handle, suffix) + end_mark = self.get_mark() + return TagToken(value, start_mark, end_mark) + + def scan_block_scalar(self, style): + # See the specification for details. + + if style == '>': + folded = True + else: + folded = False + + chunks = [] + start_mark = self.get_mark() + + # Scan the header. + self.forward() + chomping, increment = self.scan_block_scalar_indicators(start_mark) + self.scan_block_scalar_ignored_line(start_mark) + + # Determine the indentation level and go to the first non-empty line. + min_indent = self.indent+1 + if min_indent < 1: + min_indent = 1 + if increment is None: + breaks, max_indent, end_mark = self.scan_block_scalar_indentation() + indent = max(min_indent, max_indent) + else: + indent = min_indent+increment-1 + breaks, end_mark = self.scan_block_scalar_breaks(indent) + line_break = '' + + # Scan the inner part of the block scalar. + while self.column == indent and self.peek() != '\0': + chunks.extend(breaks) + leading_non_space = self.peek() not in ' \t' + length = 0 + while self.peek(length) not in '\0\r\n\x85\u2028\u2029': + length += 1 + chunks.append(self.prefix(length)) + self.forward(length) + line_break = self.scan_line_break() + breaks, end_mark = self.scan_block_scalar_breaks(indent) + if self.column == indent and self.peek() != '\0': + + # Unfortunately, folding rules are ambiguous. + # + # This is the folding according to the specification: + + if folded and line_break == '\n' \ + and leading_non_space and self.peek() not in ' \t': + if not breaks: + chunks.append(' ') + else: + chunks.append(line_break) + + # This is Clark Evans's interpretation (also in the spec + # examples): + # + #if folded and line_break == '\n': + # if not breaks: + # if self.peek() not in ' \t': + # chunks.append(' ') + # else: + # chunks.append(line_break) + #else: + # chunks.append(line_break) + else: + break + + # Chomp the tail. + if chomping is not False: + chunks.append(line_break) + if chomping is True: + chunks.extend(breaks) + + # We are done. + return ScalarToken(''.join(chunks), False, start_mark, end_mark, + style) + + def scan_block_scalar_indicators(self, start_mark): + # See the specification for details. + chomping = None + increment = None + ch = self.peek() + if ch in '+-': + if ch == '+': + chomping = True + else: + chomping = False + self.forward() + ch = self.peek() + if ch in '0123456789': + increment = int(ch) + if increment == 0: + raise ScannerError("while scanning a block scalar", start_mark, + "expected indentation indicator in the range 1-9, but found 0", + self.get_mark()) + self.forward() + elif ch in '0123456789': + increment = int(ch) + if increment == 0: + raise ScannerError("while scanning a block scalar", start_mark, + "expected indentation indicator in the range 1-9, but found 0", + self.get_mark()) + self.forward() + ch = self.peek() + if ch in '+-': + if ch == '+': + chomping = True + else: + chomping = False + self.forward() + ch = self.peek() + if ch not in '\0 \r\n\x85\u2028\u2029': + raise ScannerError("while scanning a block scalar", start_mark, + "expected chomping or indentation indicators, but found %r" + % ch, self.get_mark()) + return chomping, increment + + def scan_block_scalar_ignored_line(self, start_mark): + # See the specification for details. + while self.peek() == ' ': + self.forward() + if self.peek() == '#': + while self.peek() not in '\0\r\n\x85\u2028\u2029': + self.forward() + ch = self.peek() + if ch not in '\0\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a block scalar", start_mark, + "expected a comment or a line break, but found %r" % ch, + self.get_mark()) + self.scan_line_break() + + def scan_block_scalar_indentation(self): + # See the specification for details. + chunks = [] + max_indent = 0 + end_mark = self.get_mark() + while self.peek() in ' \r\n\x85\u2028\u2029': + if self.peek() != ' ': + chunks.append(self.scan_line_break()) + end_mark = self.get_mark() + else: + self.forward() + if self.column > max_indent: + max_indent = self.column + return chunks, max_indent, end_mark + + def scan_block_scalar_breaks(self, indent): + # See the specification for details. + chunks = [] + end_mark = self.get_mark() + while self.column < indent and self.peek() == ' ': + self.forward() + while self.peek() in '\r\n\x85\u2028\u2029': + chunks.append(self.scan_line_break()) + end_mark = self.get_mark() + while self.column < indent and self.peek() == ' ': + self.forward() + return chunks, end_mark + + def scan_flow_scalar(self, style): + # See the specification for details. + # Note that we loose indentation rules for quoted scalars. Quoted + # scalars don't need to adhere indentation because " and ' clearly + # mark the beginning and the end of them. Therefore we are less + # restrictive then the specification requires. We only need to check + # that document separators are not included in scalars. + if style == '"': + double = True + else: + double = False + chunks = [] + start_mark = self.get_mark() + quote = self.peek() + self.forward() + chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark)) + while self.peek() != quote: + chunks.extend(self.scan_flow_scalar_spaces(double, start_mark)) + chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark)) + self.forward() + end_mark = self.get_mark() + return ScalarToken(''.join(chunks), False, start_mark, end_mark, + style) + + ESCAPE_REPLACEMENTS = { + '0': '\0', + 'a': '\x07', + 'b': '\x08', + 't': '\x09', + '\t': '\x09', + 'n': '\x0A', + 'v': '\x0B', + 'f': '\x0C', + 'r': '\x0D', + 'e': '\x1B', + ' ': '\x20', + '\"': '\"', + '\\': '\\', + '/': '/', + 'N': '\x85', + '_': '\xA0', + 'L': '\u2028', + 'P': '\u2029', + } + + ESCAPE_CODES = { + 'x': 2, + 'u': 4, + 'U': 8, + } + + def scan_flow_scalar_non_spaces(self, double, start_mark): + # See the specification for details. + chunks = [] + while True: + length = 0 + while self.peek(length) not in '\'\"\\\0 \t\r\n\x85\u2028\u2029': + length += 1 + if length: + chunks.append(self.prefix(length)) + self.forward(length) + ch = self.peek() + if not double and ch == '\'' and self.peek(1) == '\'': + chunks.append('\'') + self.forward(2) + elif (double and ch == '\'') or (not double and ch in '\"\\'): + chunks.append(ch) + self.forward() + elif double and ch == '\\': + self.forward() + ch = self.peek() + if ch in self.ESCAPE_REPLACEMENTS: + chunks.append(self.ESCAPE_REPLACEMENTS[ch]) + self.forward() + elif ch in self.ESCAPE_CODES: + length = self.ESCAPE_CODES[ch] + self.forward() + for k in range(length): + if self.peek(k) not in '0123456789ABCDEFabcdef': + raise ScannerError("while scanning a double-quoted scalar", start_mark, + "expected escape sequence of %d hexdecimal numbers, but found %r" % + (length, self.peek(k)), self.get_mark()) + code = int(self.prefix(length), 16) + chunks.append(chr(code)) + self.forward(length) + elif ch in '\r\n\x85\u2028\u2029': + self.scan_line_break() + chunks.extend(self.scan_flow_scalar_breaks(double, start_mark)) + else: + raise ScannerError("while scanning a double-quoted scalar", start_mark, + "found unknown escape character %r" % ch, self.get_mark()) + else: + return chunks + + def scan_flow_scalar_spaces(self, double, start_mark): + # See the specification for details. + chunks = [] + length = 0 + while self.peek(length) in ' \t': + length += 1 + whitespaces = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch == '\0': + raise ScannerError("while scanning a quoted scalar", start_mark, + "found unexpected end of stream", self.get_mark()) + elif ch in '\r\n\x85\u2028\u2029': + line_break = self.scan_line_break() + breaks = self.scan_flow_scalar_breaks(double, start_mark) + if line_break != '\n': + chunks.append(line_break) + elif not breaks: + chunks.append(' ') + chunks.extend(breaks) + else: + chunks.append(whitespaces) + return chunks + + def scan_flow_scalar_breaks(self, double, start_mark): + # See the specification for details. + chunks = [] + while True: + # Instead of checking indentation, we check for document + # separators. + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + raise ScannerError("while scanning a quoted scalar", start_mark, + "found unexpected document separator", self.get_mark()) + while self.peek() in ' \t': + self.forward() + if self.peek() in '\r\n\x85\u2028\u2029': + chunks.append(self.scan_line_break()) + else: + return chunks + + def scan_plain(self): + # See the specification for details. + # We add an additional restriction for the flow context: + # plain scalars in the flow context cannot contain ',' or '?'. + # We also keep track of the `allow_simple_key` flag here. + # Indentation rules are loosed for the flow context. + chunks = [] + start_mark = self.get_mark() + end_mark = start_mark + indent = self.indent+1 + # We allow zero indentation for scalars, but then we need to check for + # document separators at the beginning of the line. + #if indent == 0: + # indent = 1 + spaces = [] + while True: + length = 0 + if self.peek() == '#': + break + while True: + ch = self.peek(length) + if ch in '\0 \t\r\n\x85\u2028\u2029' \ + or (ch == ':' and + self.peek(length+1) in '\0 \t\r\n\x85\u2028\u2029' + + (u',[]{}' if self.flow_level else u''))\ + or (self.flow_level and ch in ',?[]{}'): + break + length += 1 + if length == 0: + break + self.allow_simple_key = False + chunks.extend(spaces) + chunks.append(self.prefix(length)) + self.forward(length) + end_mark = self.get_mark() + spaces = self.scan_plain_spaces(indent, start_mark) + if not spaces or self.peek() == '#' \ + or (not self.flow_level and self.column < indent): + break + return ScalarToken(''.join(chunks), True, start_mark, end_mark) + + def scan_plain_spaces(self, indent, start_mark): + # See the specification for details. + # The specification is really confusing about tabs in plain scalars. + # We just forbid them completely. Do not use tabs in YAML! + chunks = [] + length = 0 + while self.peek(length) in ' ': + length += 1 + whitespaces = self.prefix(length) + self.forward(length) + ch = self.peek() + if ch in '\r\n\x85\u2028\u2029': + line_break = self.scan_line_break() + self.allow_simple_key = True + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return + breaks = [] + while self.peek() in ' \r\n\x85\u2028\u2029': + if self.peek() == ' ': + self.forward() + else: + breaks.append(self.scan_line_break()) + prefix = self.prefix(3) + if (prefix == '---' or prefix == '...') \ + and self.peek(3) in '\0 \t\r\n\x85\u2028\u2029': + return + if line_break != '\n': + chunks.append(line_break) + elif not breaks: + chunks.append(' ') + chunks.extend(breaks) + elif whitespaces: + chunks.append(whitespaces) + return chunks + + def scan_tag_handle(self, name, start_mark): + # See the specification for details. + # For some strange reasons, the specification does not allow '_' in + # tag handles. I have allowed it anyway. + ch = self.peek() + if ch != '!': + raise ScannerError("while scanning a %s" % name, start_mark, + "expected '!', but found %r" % ch, self.get_mark()) + length = 1 + ch = self.peek(length) + if ch != ' ': + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-_': + length += 1 + ch = self.peek(length) + if ch != '!': + self.forward(length) + raise ScannerError("while scanning a %s" % name, start_mark, + "expected '!', but found %r" % ch, self.get_mark()) + length += 1 + value = self.prefix(length) + self.forward(length) + return value + + def scan_tag_uri(self, name, start_mark): + # See the specification for details. + # Note: we do not check if URI is well-formed. + chunks = [] + length = 0 + ch = self.peek(length) + while '0' <= ch <= '9' or 'A' <= ch <= 'Z' or 'a' <= ch <= 'z' \ + or ch in '-;/?:@&=+$,_.!~*\'()[]%': + if ch == '%': + chunks.append(self.prefix(length)) + self.forward(length) + length = 0 + chunks.append(self.scan_uri_escapes(name, start_mark)) + else: + length += 1 + ch = self.peek(length) + if length: + chunks.append(self.prefix(length)) + self.forward(length) + length = 0 + if not chunks: + raise ScannerError("while parsing a %s" % name, start_mark, + "expected URI, but found %r" % ch, self.get_mark()) + return ''.join(chunks) + + def scan_uri_escapes(self, name, start_mark): + # See the specification for details. + codes = [] + mark = self.get_mark() + while self.peek() == '%': + self.forward() + for k in range(2): + if self.peek(k) not in '0123456789ABCDEFabcdef': + raise ScannerError("while scanning a %s" % name, start_mark, + "expected URI escape sequence of 2 hexdecimal numbers, but found %r" + % self.peek(k), self.get_mark()) + codes.append(int(self.prefix(2), 16)) + self.forward(2) + try: + value = bytes(codes).decode('utf-8') + except UnicodeDecodeError as exc: + raise ScannerError("while scanning a %s" % name, start_mark, str(exc), mark) + return value + + def scan_line_break(self): + # Transforms: + # '\r\n' : '\n' + # '\r' : '\n' + # '\n' : '\n' + # '\x85' : '\n' + # '\u2028' : '\u2028' + # '\u2029 : '\u2029' + # default : '' + ch = self.peek() + if ch in '\r\n\x85': + if self.prefix(2) == '\r\n': + self.forward(2) + else: + self.forward() + return '\n' + elif ch in '\u2028\u2029': + self.forward() + return ch + return '' diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/serializer.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/serializer.py new file mode 100644 index 00000000..fe911e67 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/serializer.py @@ -0,0 +1,111 @@ + +__all__ = ['Serializer', 'SerializerError'] + +from .error import YAMLError +from .events import * +from .nodes import * + +class SerializerError(YAMLError): + pass + +class Serializer: + + ANCHOR_TEMPLATE = 'id%03d' + + def __init__(self, encoding=None, + explicit_start=None, explicit_end=None, version=None, tags=None): + self.use_encoding = encoding + self.use_explicit_start = explicit_start + self.use_explicit_end = explicit_end + self.use_version = version + self.use_tags = tags + self.serialized_nodes = {} + self.anchors = {} + self.last_anchor_id = 0 + self.closed = None + + def open(self): + if self.closed is None: + self.emit(StreamStartEvent(encoding=self.use_encoding)) + self.closed = False + elif self.closed: + raise SerializerError("serializer is closed") + else: + raise SerializerError("serializer is already opened") + + def close(self): + if self.closed is None: + raise SerializerError("serializer is not opened") + elif not self.closed: + self.emit(StreamEndEvent()) + self.closed = True + + #def __del__(self): + # self.close() + + def serialize(self, node): + if self.closed is None: + raise SerializerError("serializer is not opened") + elif self.closed: + raise SerializerError("serializer is closed") + self.emit(DocumentStartEvent(explicit=self.use_explicit_start, + version=self.use_version, tags=self.use_tags)) + self.anchor_node(node) + self.serialize_node(node, None, None) + self.emit(DocumentEndEvent(explicit=self.use_explicit_end)) + self.serialized_nodes = {} + self.anchors = {} + self.last_anchor_id = 0 + + def anchor_node(self, node): + if node in self.anchors: + if self.anchors[node] is None: + self.anchors[node] = self.generate_anchor(node) + else: + self.anchors[node] = None + if isinstance(node, SequenceNode): + for item in node.value: + self.anchor_node(item) + elif isinstance(node, MappingNode): + for key, value in node.value: + self.anchor_node(key) + self.anchor_node(value) + + def generate_anchor(self, node): + self.last_anchor_id += 1 + return self.ANCHOR_TEMPLATE % self.last_anchor_id + + def serialize_node(self, node, parent, index): + alias = self.anchors[node] + if node in self.serialized_nodes: + self.emit(AliasEvent(alias)) + else: + self.serialized_nodes[node] = True + self.descend_resolver(parent, index) + if isinstance(node, ScalarNode): + detected_tag = self.resolve(ScalarNode, node.value, (True, False)) + default_tag = self.resolve(ScalarNode, node.value, (False, True)) + implicit = (node.tag == detected_tag), (node.tag == default_tag) + self.emit(ScalarEvent(alias, node.tag, implicit, node.value, + style=node.style)) + elif isinstance(node, SequenceNode): + implicit = (node.tag + == self.resolve(SequenceNode, node.value, True)) + self.emit(SequenceStartEvent(alias, node.tag, implicit, + flow_style=node.flow_style)) + index = 0 + for item in node.value: + self.serialize_node(item, node, index) + index += 1 + self.emit(SequenceEndEvent()) + elif isinstance(node, MappingNode): + implicit = (node.tag + == self.resolve(MappingNode, node.value, True)) + self.emit(MappingStartEvent(alias, node.tag, implicit, + flow_style=node.flow_style)) + for key, value in node.value: + self.serialize_node(key, node, None) + self.serialize_node(value, node, key) + self.emit(MappingEndEvent()) + self.ascend_resolver() + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/tokens.py b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/tokens.py new file mode 100644 index 00000000..4d0b48a3 --- /dev/null +++ b/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/yaml/tokens.py @@ -0,0 +1,104 @@ + +class Token(object): + def __init__(self, start_mark, end_mark): + self.start_mark = start_mark + self.end_mark = end_mark + def __repr__(self): + attributes = [key for key in self.__dict__ + if not key.endswith('_mark')] + attributes.sort() + arguments = ', '.join(['%s=%r' % (key, getattr(self, key)) + for key in attributes]) + return '%s(%s)' % (self.__class__.__name__, arguments) + +#class BOMToken(Token): +# id = '' + +class DirectiveToken(Token): + id = '' + def __init__(self, name, value, start_mark, end_mark): + self.name = name + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class DocumentStartToken(Token): + id = '' + +class DocumentEndToken(Token): + id = '' + +class StreamStartToken(Token): + id = '' + def __init__(self, start_mark=None, end_mark=None, + encoding=None): + self.start_mark = start_mark + self.end_mark = end_mark + self.encoding = encoding + +class StreamEndToken(Token): + id = '' + +class BlockSequenceStartToken(Token): + id = '' + +class BlockMappingStartToken(Token): + id = '' + +class BlockEndToken(Token): + id = '' + +class FlowSequenceStartToken(Token): + id = '[' + +class FlowMappingStartToken(Token): + id = '{' + +class FlowSequenceEndToken(Token): + id = ']' + +class FlowMappingEndToken(Token): + id = '}' + +class KeyToken(Token): + id = '?' + +class ValueToken(Token): + id = ':' + +class BlockEntryToken(Token): + id = '-' + +class FlowEntryToken(Token): + id = ',' + +class AliasToken(Token): + id = '' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class AnchorToken(Token): + id = '' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class TagToken(Token): + id = '' + def __init__(self, value, start_mark, end_mark): + self.value = value + self.start_mark = start_mark + self.end_mark = end_mark + +class ScalarToken(Token): + id = '' + def __init__(self, value, plain, start_mark, end_mark, style=None): + self.value = value + self.plain = plain + self.start_mark = start_mark + self.end_mark = end_mark + self.style = style + diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_RobotDB.exe b/Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_RobotDB.exe deleted file mode 100644 index 66a6265ce8c6d564afeaad63d75bbe97fe045230..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99856 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

L?vYr|Q^&u?6qVxh(g2Uc6&X)q0r7 zv(@_h?XANro2V5NmsAQF&1dp+9?X23sdSEL(Hw2dxS31gYTojyQ2KJ7)r0Q|oyA^N z472`~RT)M>!zEsp+@3`beRNMvG=K2YOsSx}Es-X9>dv$ld|h&L{6YGpaa`K!p|=`E zrrSqvB?U}B^2bN;ojwymtXs+LASrZF70w4vuL@fZ7rM3tJEtgp&NkxY@B3a2P*6PPN!2Q(O_t*!mO)6<>BNvtCV>kCJri% z-MBGnY?VjdzYTxreO>z%)wpvjrkuo*gu=hkNj5IgQU;Y}hy(LWPGUrJQ1iu#OV1L^ z3>L?=h%pxM>TezLC}pM%KfUBAi*rsvU4XvLeo*}D07-BC#Z~vl&ob7_2M57(|8 zuDUr%*@{zbm($y|Y|3M6(%G2KXKPI0m>9p8sZ!3RNz#HV{>ypV+9SwDu=7xBp>wC&P6=JZ@N8%94npP({PH`6opVc zhr>#INJ9_4CD(+B+Pd7ExKFvNIQ5_=!>_POByOp@AXQSip76D{bTmU7ftED&^}Tgx z-Uv>IG)eqgFf{#P{AGl3rQA*K64%Ag1oaiC?rNpfHSUVrIwqJ$Dmn>hDTYxq{as150^Hb(L8i?J&qCskKc&PiK7G9tHHN0-XGL`xD< z_B{2zGBEbg^t5y7BRd1J_oM3%U)E?cwOZ``eO)tBfA{%XZv&I5j%U=Gv-YWa?=spD z-jyX9BuR7g&xTh!4U+Hd%j42_s&hjp7D<_Dx_#zW;hA8rY~8b!mSxz?Wm6m4f&&QN>0TW) zNko+_Q|Hx|@%5d4YRHp;fgj*9!#$rDC(2zs!A$(ASSxpK-oZoTyReb<(oef5^WvjO zQne}RBd^Q%hr6#x2{DU%Jt*zDaXyd4K{!Pg9%A;K&Mth2y)bia;;>4z{`|bO#H6yx zlMPEp!)p5R_y~Sv*e#)u-+{L(*h~{ieETYn{^`xGsjH<-#l~kR3qBQ-D3j*rs98}d zYVG)EGyZw_BnfJ*N2-JLMxn9gDGl!?-w&&|`snv>@cfdyVTNqUyM5|$ze(w>{HSL) z)@Ndl4=+)WPT|RSe+r+14n3Gyvt5R|qi5~T_YTio;d^lDSG<|vg5aHhg?^6xxk+or zmUkj;a?6znfsXo!P0K8YX!awQ^7% zN)`0mlsL9WdOXAWP{qgU<1gBSH(0?IeDeL1A5RxF2f{{mVC|**;qmFUFYn`HO$?Bv z_dQAj<+t>lb#i`P`FdoN=QbOA5#+DEIs8kjv^}P-Aa0n6t$%R|#HsH2ijS1qMYV69 z$LxF}rdp^x=H#6CXi?<3)&+`V(S4>K8+S4FA50PQtQmha7QSs-eOlHzP~u0uCVq0LL!gk+efy4n z)x^^se61Mms}l`-FmINXxh;BaSJ)S}<~CMQ*aJdAzRiJdd7F_E{nf9-t0%@UrT%LE z9IttQhMk#Io0dBR$JG-lSMomN*Z&w`6mxAvOKLD z9b4IAwl|Fb(6z*$=FH7|N8jD^mWS|j`a9+Vu1(1VC;a@!2yIep1mAHfGi%kf#KF

#x7%*StZ3k^01N)pU!# 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 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_Studio.exe b/Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_Studio.exe deleted file mode 100644 index 66a6265ce8c6d564afeaad63d75bbe97fe045230..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99856 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

L?vYr|Q^&u?6qVxh(g2Uc6&X)q0r7 zv(@_h?XANro2V5NmsAQF&1dp+9?X23sdSEL(Hw2dxS31gYTojyQ2KJ7)r0Q|oyA^N z472`~RT)M>!zEsp+@3`beRNMvG=K2YOsSx}Es-X9>dv$ld|h&L{6YGpaa`K!p|=`E zrrSqvB?U}B^2bN;ojwymtXs+LASrZF70w4vuL@fZ7rM3tJEtgp&NkxY@B3a2P*6PPN!2Q(O_t*!mO)6<>BNvtCV>kCJri% z-MBGnY?VjdzYTxreO>z%)wpvjrkuo*gu=hkNj5IgQU;Y}hy(LWPGUrJQ1iu#OV1L^ z3>L?=h%pxM>TezLC}pM%KfUBAi*rsvU4XvLeo*}D07-BC#Z~vl&ob7_2M57(|8 zuDUr%*@{zbm($y|Y|3M6(%G2KXKPI0m>9p8sZ!3RNz#HV{>ypV+9SwDu=7xBp>wC&P6=JZ@N8%94npP({PH`6opVc zhr>#INJ9_4CD(+B+Pd7ExKFvNIQ5_=!>_POByOp@AXQSip76D{bTmU7ftED&^}Tgx z-Uv>IG)eqgFf{#P{AGl3rQA*K64%Ag1oaiC?rNpfHSUVrIwqJ$Dmn>hDTYxq{as150^Hb(L8i?J&qCskKc&PiK7G9tHHN0-XGL`xD< z_B{2zGBEbg^t5y7BRd1J_oM3%U)E?cwOZ``eO)tBfA{%XZv&I5j%U=Gv-YWa?=spD z-jyX9BuR7g&xTh!4U+Hd%j42_s&hjp7D<_Dx_#zW;hA8rY~8b!mSxz?Wm6m4f&&QN>0TW) zNko+_Q|Hx|@%5d4YRHp;fgj*9!#$rDC(2zs!A$(ASSxpK-oZoTyReb<(oef5^WvjO zQne}RBd^Q%hr6#x2{DU%Jt*zDaXyd4K{!Pg9%A;K&Mth2y)bia;;>4z{`|bO#H6yx zlMPEp!)p5R_y~Sv*e#)u-+{L(*h~{ieETYn{^`xGsjH<-#l~kR3qBQ-D3j*rs98}d zYVG)EGyZw_BnfJ*N2-JLMxn9gDGl!?-w&&|`snv>@cfdyVTNqUyM5|$ze(w>{HSL) z)@Ndl4=+)WPT|RSe+r+14n3Gyvt5R|qi5~T_YTio;d^lDSG<|vg5aHhg?^6xxk+or zmUkj;a?6znfsXo!P0K8YX!awQ^7% zN)`0mlsL9WdOXAWP{qgU<1gBSH(0?IeDeL1A5RxF2f{{mVC|**;qmFUFYn`HO$?Bv z_dQAj<+t>lb#i`P`FdoN=QbOA5#+DEIs8kjv^}P-Aa0n6t$%R|#HsH2ijS1qMYV69 z$LxF}rdp^x=H#6CXi?<3)&+`V(S4>K8+S4FA50PQtQmha7QSs-eOlHzP~u0uCVq0LL!gk+efy4n z)x^^se61Mms}l`-FmINXxh;BaSJ)S}<~CMQ*aJdAzRiJdd7F_E{nf9-t0%@UrT%LE z9IttQhMk#Io0dBR$JG-lSMomN*Z&w`6mxAvOKLD z9b4IAwl|Fb(6z*$=FH7|N8jD^mWS|j`a9+Vu1(1VC;a@!2yIep1mAHfGi%kf#KF

#x7%*StZ3k^01N)pU!# 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 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_ToolScreenScrapRecognize.exe b/Resources/WPy64-3720/python-3.7.2.amd64/OpenRPA_ToolScreenScrapRecognize.exe deleted file mode 100644 index 66a6265ce8c6d564afeaad63d75bbe97fe045230..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99856 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

L?vYr|Q^&u?6qVxh(g2Uc6&X)q0r7 zv(@_h?XANro2V5NmsAQF&1dp+9?X23sdSEL(Hw2dxS31gYTojyQ2KJ7)r0Q|oyA^N z472`~RT)M>!zEsp+@3`beRNMvG=K2YOsSx}Es-X9>dv$ld|h&L{6YGpaa`K!p|=`E zrrSqvB?U}B^2bN;ojwymtXs+LASrZF70w4vuL@fZ7rM3tJEtgp&NkxY@B3a2P*6PPN!2Q(O_t*!mO)6<>BNvtCV>kCJri% z-MBGnY?VjdzYTxreO>z%)wpvjrkuo*gu=hkNj5IgQU;Y}hy(LWPGUrJQ1iu#OV1L^ z3>L?=h%pxM>TezLC}pM%KfUBAi*rsvU4XvLeo*}D07-BC#Z~vl&ob7_2M57(|8 zuDUr%*@{zbm($y|Y|3M6(%G2KXKPI0m>9p8sZ!3RNz#HV{>ypV+9SwDu=7xBp>wC&P6=JZ@N8%94npP({PH`6opVc zhr>#INJ9_4CD(+B+Pd7ExKFvNIQ5_=!>_POByOp@AXQSip76D{bTmU7ftED&^}Tgx z-Uv>IG)eqgFf{#P{AGl3rQA*K64%Ag1oaiC?rNpfHSUVrIwqJ$Dmn>hDTYxq{as150^Hb(L8i?J&qCskKc&PiK7G9tHHN0-XGL`xD< z_B{2zGBEbg^t5y7BRd1J_oM3%U)E?cwOZ``eO)tBfA{%XZv&I5j%U=Gv-YWa?=spD z-jyX9BuR7g&xTh!4U+Hd%j42_s&hjp7D<_Dx_#zW;hA8rY~8b!mSxz?Wm6m4f&&QN>0TW) zNko+_Q|Hx|@%5d4YRHp;fgj*9!#$rDC(2zs!A$(ASSxpK-oZoTyReb<(oef5^WvjO zQne}RBd^Q%hr6#x2{DU%Jt*zDaXyd4K{!Pg9%A;K&Mth2y)bia;;>4z{`|bO#H6yx zlMPEp!)p5R_y~Sv*e#)u-+{L(*h~{ieETYn{^`xGsjH<-#l~kR3qBQ-D3j*rs98}d zYVG)EGyZw_BnfJ*N2-JLMxn9gDGl!?-w&&|`snv>@cfdyVTNqUyM5|$ze(w>{HSL) z)@Ndl4=+)WPT|RSe+r+14n3Gyvt5R|qi5~T_YTio;d^lDSG<|vg5aHhg?^6xxk+or zmUkj;a?6znfsXo!P0K8YX!awQ^7% zN)`0mlsL9WdOXAWP{qgU<1gBSH(0?IeDeL1A5RxF2f{{mVC|**;qmFUFYn`HO$?Bv z_dQAj<+t>lb#i`P`FdoN=QbOA5#+DEIs8kjv^}P-Aa0n6t$%R|#HsH2ijS1qMYV69 z$LxF}rdp^x=H#6CXi?<3)&+`V(S4>K8+S4FA50PQtQmha7QSs-eOlHzP~u0uCVq0LL!gk+efy4n z)x^^se61Mms}l`-FmINXxh;BaSJ)S}<~CMQ*aJdAzRiJdd7F_E{nf9-t0%@UrT%LE z9IttQhMk#Io0dBR$JG-lSMomN*Z&w`6mxAvOKLD z9b4IAwl|Fb(6z*$=FH7|N8jD^mWS|j`a9+Vu1(1VC;a@!2yIep1mAHfGi%kf#KF

#x7%*StZ3k^01N)pU!# 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 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Scripts/crypto.exe b/Resources/WPy64-3720/python-3.7.2.amd64/Scripts/crypto.exe new file mode 100644 index 0000000000000000000000000000000000000000..94d4b9bd9ec0499636acbe9386cf001d2e05f437 GIT binary patch literal 102728 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�?dYNUd4WaURX_A__M4W}D0!0n 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 K_0cvy5BvvFA|TrU literal 0 HcmV?d00001 diff --git a/Resources/WPy64-3720/python-3.7.2.amd64/Scripts/decrypto.exe b/Resources/WPy64-3720/python-3.7.2.amd64/Scripts/decrypto.exe new file mode 100644 index 0000000000000000000000000000000000000000..dbe031bbe023a563686665e980941e1ffa13d494 GIT binary patch literal 102736 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�?dYNUd4WaURX_A__M4W}D0!0n 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�?dYNUd4WaURX_A__M4W}D0!0n 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.6.6','WMI>=1.4.9','pillow>=6.0.0','keyboard>=0.13.3','pyautogui>=0.9.44','pywin32>=224' + 'pywinauto>=0.6.6','WMI>=1.4.9','pillow>=6.0.0','keyboard>=0.13.3','pyautogui>=0.9.44','pywin32>=224', 'crypto>=1.4.1' ], include_package_data=True, #data_files = datafiles,